现在的位置: 首页 > 综合 > 正文

脚本漏洞不完全挖掘脚本

2012年11月13日 ⁄ 综合 ⁄ 共 1463字 ⁄ 字号 评论关闭
<?php
if(@set_time_limit(0)) ini_set("max_execution_time",0);

//配置
$wwwpath='D:\\wwwroot'; //你的web根目录
$wwwurl='http://127.0.0.1'; //访问你web根目录的url
//配置结束

$path='D:\wwwroot\phpscripts\PHPWind_GBK_5.3'; //你要检测脚本所在路径
$script_array=list_dir($path);

$path=str_replace($wwwpath,'',$path);
$path=str_replace('\\','/',$path);
$baseurl=$wwwurl.$path;
$result=0;

echo "脚本漏洞挖掘脚本<br>";
echo "Editor By:Ivory AT 77169.com<br>";
echo "<br>";
echo "<br>";
echo "=========================================================================<br>";

foreach($script_array as $value) {
$fuckurl=$baseurl.$value;
$temp=@file_get_contents($fuckurl);
if(strpos($temp,'Fatal error')||strpos($temp,'Warning')) {//关键字可自行修改
$result=$result+1;
echo "Find $value;\t\t\t<a href=$fuckurl>$value</a><br>";
continue;
}
}

echo "<br>=========================================================================<br>";
if($result) {
echo "好了,恭喜你,你找到了 $result 个漏洞!<nr><br>";
}
else {
echo "晕,可能您输入的路径有问题<br>请修改路径重新开始吧!<br>";
}

function list_dir($dirname)
{
//变量
global $scan_ex,$count_all,$path;
//Win系统
// if($dirname[strlen($dirname)-1]!='\\')
// $dirname.='\\';
//*inx系统
if($dirname[strlen($dirname)-1]!='/') $dirname.='/';
static $result_array=array(); //静态数组,保存函数返回值。
$handle=opendir($dirname);
while ($file = readdir($handle)) {
if($file=='.'||$file=='..') continue;
if(is_dir($dirname.$file)) list_dir($dirname.$file.'/'); //如果是目录,递归调用。
if(strpos($file,'.php')) {//后缀可自行修改
$result_array[]=str_replace($path,'',$dirname.$file);
$count_all=$count_all+1;
}
}
closedir($handle);
return $result_array;
}

?>

抱歉!评论已关闭.