I wrote such a script for my site, it seemed to help. Just make a backup to start your site. And one more limitation: if there are a lot of files, then the script is better to use several times for individual folders. To specify a folder you need to change the variable $ dir
<?php header("Content-Type: text/html; charset=utf-8"); $dir = $_SERVER["DOCUMENT_ROOT"] ; cleanDir($dir); function cleanDir($location){ if ($handle = opendir($location)) { echo "Директория: $handle<br />"; echo "Содержимое:<br />"; while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { if(is_dir ($location.DIRECTORY_SEPARATOR .$entry)){ print '<span style="background-color:#ddd;">'.$location.DIRECTORY_SEPARATOR .$entry."</span><br />"; cleanDir($location.DIRECTORY_SEPARATOR .$entry); }else{ if(pathinfo($entry, PATHINFO_EXTENSION)=='js'){ $c = false; $c = clearFile($location.DIRECTORY_SEPARATOR.$entry); if($c){ print '<span style="background-color:red;">VIRUS</span><span style="background-color:#fff;margin-left:20px;">'.$location.DIRECTORY_SEPARATOR .$entry."</span><br />"; }else{ print '<span style="background-color:green;">CLEAR</span><span style="background-color:#fff;margin-left:20px;">'.$location.DIRECTORY_SEPARATOR .$entry."</span><br />"; } } } } } closedir($handle); }else{ print "Error !"; die(); } } function clearFile($path){ $cont = file_get_contents($path); $pos = strrpos($cont,'try{q=document.createElement("d"+"i"+"v");q.appendChild(q+"");}'); if($pos){ $cont = substr($cont,0,$pos); file_put_contents($path,$cont); return true; } return false; }
Notepad++
and others like it. - KoVadim