Plus to @ Sharp- eyed and add on my own: faced with this problem several times. Helped change passwords + wrote a script that runs through all the files and "chopping off" tails.
Added by
<? $RD = dirname(__FILE__); function delVirus($dir) { $m = glob($dir.'/*.js'); $ml = sizeof($m); if($m) for($i = 0; $i < $ml; ++$i) { $t = file_get_contents($m[$i]); echo '['.$m[$i].']'; if($s = strpos($t, "var _0x5cb4")) { $t = substr($t, 0, $s); $t = file_put_contents($m[$i], $t); echo ' +'; } echo '<br>'; } if(!$handle = opendir($dir)) break; while(false !== ($file = readdir($handle))) { if($file != '.' && $file != '..' && is_dir($dir.'/'.$file)) { delVirus($dir.'/'.$file); } } } delVirus($RD); ?>
This option removes from *.js
everything that starts with var _0x5cb4
. If the virus got into php and starts from a different line, the script is easy to edit.