// *=========================================================================
// * Intro 扫描网站敏感目录的js脚本
// * Usage 把本脚本wwwcan.js、字典文件Dictionary.txt放在同一目录下
// 在命令提示符下输入:Cscript.exe wwwcan.js www.baidu.com
// 扫描结果保存在同目录下的Result.txt文件中
// * Author 雨中风铃
// * WEB http://hi.baidu.com/yanfei6
// *=========================================================================
function getResponse(strURL)
{
var strResult;
try
{
var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
WinHttpReq.SetTimeouts(30000, 30000, 30000, 30000);
WinHttpReq.Open("GET", strURL, false);
WinHttpReq.Send();
strResult = strURL + " -> "
strResult += WinHttpReq.Status + " " + WinHttpReq.StatusText;
}
catch (objError)
{
strResult = objError.description;
}
WScript.Echo(strResult);
if (WinHttpReq.Status != 404) SaveResult(strResult);
}
function ScanPath(strURL)
{
var ForReading = 1;
var fso = new ActiveXObject("Scripting.FileSystemObject");
var filename = "Dictionary.txt";
var f = fso.OpenTextFile(filename, ForReading);
while (!f.AtEndOfStream)
{
var r = f.ReadLine().replace(/^\s+|\s+$/g,"");
if (r.length == 0 ) continue;
getResponse(strURL + r);
}
f.Close();
}
function SaveResult(strURL)
{
var ForAppending = 8;
var fso = new ActiveXObject("Scripting.FileSystemObject");
var filename = "Result.txt";
var f = fso.OpenTextFile(filename, ForAppending, true);
f.WriteLine(strURL);
f.Close();
}
function CheckInput()
{
var strURL;
objArgs = WScript.Arguments;
if (objArgs.length != 1) WScript.Quit(1);
strURL = objArgs(0);
if (strURL.substr(0, 7).toLowerCase() != "http://")
{
strURL = "http://" + strURL;
}
if (strURL.charAt(strURL.length-1) != "/")
{
strURL = strURL + "/";
}
return strURL;
}
var strURL = CheckInput();
ScanPath(strURL);
---------------------------------------代码完毕,以下是收集的字典文件Dictionary.txt(来自南非教主)-----------------------------------
admin.asp
adminlogin.asp
admin_index.asp
admin_left.asp
admin_login.asp
admin_main.asp
adminup.asp
admin_up.asp
admin_upload.asp
admin_upfile.asp
admin_uploads.asp
admin_upfiles.asp
ad_login.asp
ad_admin.asp
ad_upload.asp
ad_upfile.asp
addpic.asp
addimg.asp
add_img.asp
add_form.asp
add_pic.asp
user.asp
userlogin.asp
user_index.asp
user_left.asp
user_login.asp
user_main.asp
userup.asp
user_up.asp
user_upload.asp
user_upfile.asp
user_uploads.asp
user_upfiles.asp
backup.asp
backupdb.asp
conn.asp
config.asp
dir.asp
install.asp
login.asp
login1.asp