定义分类,是归档文件,好比你可以把你的工具分为渗透、溢出、网马、浏览之类的,可无限建分类
建好分类后,你可以进行第二步,根据你需要的后缀来进行分类,不建议将dll文件也分类,只把exe和webshell之类进行收集吧
第二步查找结束后,可以选择程序建立的searchresult.txt,根据提示构选要存到哪一个分类,自动存进数据库
第三步当然是进行查找了,根据自定义sql语句查找你的工具
程序只是个雏形,可以提供建议,有时间再修正bug,进行软件升级
代码如下:
<html>
<head>
<hta:application id=ohta
applicationname=myapp
border=thin
borderstyle=normal
caption=yes
maximizebutton=yes
minimizebutton=yes
showintaskbar=no
singleinstance=no
sysmenu=yes
version=1.0
windowstate=normal
scroll=yes>
<title>工具归类软件v0.1 code by lcx myweb:http://www.haiyangtop.net</title>
<meta http-equiv=content-type content=text/html; charset=gb2312>
</head>
<style>
body
{
font-size:12;
background: #dadada;
margin-left:5;
}
input
{
width:40;
overflow:visible;
border:1px solid lightblue;
background-color:#cccccc;
cursor:text;
}
button
{
border:1px solid gray;
width:260;
margin-left:2;
cursor:hand;
font-size:12;
filter:progid:dximagetransform.microsoft.gradient(startcolorstr='#eaeaff', endcolorstr='#618fff', gradienttype='0');
}
textarea
{
font-family:verdana;
font-size:12px;
overflow-x:visible;
overflow-y:scroll;
}
</style>
<body>
<center>
<br><br><br><br><br><br><br>
<div id=divlist></div>
<div id=start style=display:none;>
<div id=baobao>自定义数据库字段,也就是软件分类工作</div>
<button onclick=vbs:addinput><strong>设定字段名+</strong></button>
<button onclick=vbs:delinput><strong>减少字段名-</strong></button>
<button onclick=vbs:countall><strong>建立数据库</strong></button>
</div>
<a href=# onclick=showhidelayer('start') >程序初始化</a> </br>
<div id=starttwo style=display:none;overflow:scroll>
<button onclick=vbs:startwo><strong>工具整理第一步</strong></button>
<button onclick=vbs:showpath><strong>工具整理第二步,列表选择写入数据库</strong></button>
</div>
<a href=# onclick=showhidelayer('starttwo') >软件整理工作</a> </br>
<div id=startthree style=display:none;>
<button onclick=vbs:mysqlecute><strong>软件查找,自定义sql语句执行</strong></button>
</div>
<a href=# onclick=showhidelayer('startthree') >软件查找工作</a> </br>
<a href=# onclick=vbs:showhelp >软件使用说明</a> </br>
<br><br><br><br><br><br><br>
<div style=position: absolute; top: 30px; left: 3px id=q00>
<div style=position: absolute; top: 30px; left: 3px; width: 3; height: 2; z-index: 4 id=q2>
<p style=font-size:44pt><font color=#ffffff>○</p>
</div>
<div style=position: absolute; top: -10px; left: 0px; width: 3; height: 2; z-index: 5 id=q3>
<p style=font-size:42pt><font color=#ffffff>○</p>
</div>
<div style=position: absolute; top: 17; left: 2px; width: 6; height: 2; z-index: 1 id=q4>
<p style=font-size:32pt><font color=#ff0000>■</p>
</div>
</div></div>
</center>
<script language=vbs>
on error resume next
window.resizeto window.screen.availwidth/1.5,window.screen.availheight/1.5
window.moveto window.screen.availwidth/4,window.screen.availheight/4
'------------------------------------------自定义建数据库表模块开始---------------------------------------------------------------
set fso=createobject(scripting.filesystemobject)
set objconnection = createobject(adodb.connection)
set objrecordset = createobject(adodb.recordset)
set cn=createobject(adodb.connection)
set clx=createobject(adox.column)
set cat=createobject(adox.catalog)
set tblnam=createobject(adox.table)
sub addinput
for i=1 to 6
set input = document.createelement(input)
input.value=分类名&i
baobao.appendchild(input)
next
end sub
sub delinput
set input=document.getelementsbytagname(input)
if(input.length > 0)then baobao.removechild(input(input.length - 1))
end sub
sub countall
adcolnullable = 2
path=document.location.href
path=replace(path,file:///,)
path=replace(path,%20, )
path=replace(path,#,)
if fso.fileexists(path&.mdb) then
msgbox 数据库已存在,请删掉
end if
cat.create provider=microsoft.jet.oledb.4.0;data source=&path&.mdb
cn.open provider=microsoft.jet.oledb.4.0;data source=&path&.mdb
set cat.activeconnection = cn
tblnam.name = test
clx.parentcatalog = cat
clx.type = 3
clx.name = id
clx.properties(autoincrement) = true
tblnam.columns.append clx
for i=0 to document.all.tags(input).length -1
tblnam.columns.append document.all.tags(input).item(i).value,202,255
tblnam.columns(document.all.tags(input).item(i).value).attributes = adcolnullable
next
tblnam.columns.append demo,202,255
tblnam.columns(demo).attributes = adcolnullable
cat.tables.append tblnam
cat.tables.refresh
if fso.fileexists(path&.mdb) then
msgbox 数据库已建好,可以下一步了
end if
set clx = nothing
set cat = nothing
set fso = nothing
cn.close
set cn = nothing
end sub
'------------------------------------------自定义建数据库表模块结束-------------------------------------------------------
'-------------------------------------工具整理模块第一步----------------------------------------
on error resume next
dim keyword, dirtotal, timespend, filetotal, fso, outfile, txtresult, txtpath, spath
const my_computer = &h11&
const window_handle = 0
const options = 0
set objshell = createobject(shell.application)
set objfolder = objshell.namespace(my_computer)
set objfolderitem = objfolder.self
strpath = objfolderitem.path
function myfind(byval thepath)
dim fso, myfolder, myfile, curfolder
set fso = createobject(scripting.filesystemobject)
set curfolders = fso.getfolder(thepath)
dirtotal = dirtotal + 1
if curfolders.files.count > 0 then
for each myfile in curfolders.files
if instr(1, lcase(myfile.name), keyword) > 0 then
outfile.writeline formatpath(thepath) & \ & myfile.name
filetotal = filetotal + 1
end if
next
end if
if curfolders.subfolders.count > 0 then
for each myfolder in curfolders.subfolders
myfind formatpath(thepath) & \ & myfolder.name
next
end if
end function
function formatpath(byval thepath)
thepath = trim(thepath)
formatpath = thepath
if right(thepath, 1) = \ then formatpath = mid(thepath, 1, len(thepath) - 1)
end function
sub startwo
set objfolder = objshell.browseforfolder(window_handle, 选择你要搜索的文件夹,文件夹不宜过大超过几g哪样:, options, strpath)
if objfolder is nothing then
msgbox 您没有选择任何有效目录!
else
set objfolderitem = objfolder.self
spath = objfolderitem.path
txtpath=spath
set fso = createobject(scripting.filesystemobject)
filetotal = 0
dirtotal = 0
keyword = lcase(inputbox(请输入要整理的文件后缀:,文件搜索,.exe或.bat或.php,一般就这些,至于.dll手工添加吧))
set outfile = fso.createtextfile(spath & \searchresult.txt)
timespend = timer
myfind txtpath
timespend = round(timer - timespend,2)
txtresult = 搜索完成! & vbcrlf & 共找到文件: & filetotal & 个. & vbcrlf & 共搜索目录: & dirtotal & 个. & vbcrlf & 用时: & timespend & 秒.
msgbox txtresult &结果保存在&spath &\searchresult.txt
outfile.close
set outfile = nothing
set fso = nothing
end if
end sub
'-------------------------------------工具整理模块第一步结束----------------------------------------
'----------------------------------------工具整理模块第二步开始--------------------------------------------------
path=document.location.href
path=replace(path,file:///,)
path=replace(path,%20, )
path=replace(path,#,)
dbname=path&.mdb
'msgbox dbname
function showcolumn(mdb)
dbdriver = provider=microsoft.jet.oledb.4.0;data source=
set objconn = createobject(adodb.connection)
objconn.connectionstring = dbdriver & mdb
objconn.open
set objtablers = objconn.openschema(20,array(empty, empty, empty, table))
set objcolumnrs = objconn.openschema(4,array(empty, empty, objtablers(table_name).value))
while not objcolumnrs.eof
columns=columns&(objcolumnrs(column_name))&|
objcolumnrs.movenext
wend
showcolumn=columns
end function
sub showpath
exeurl = inputbox( 请输入刚才生成的searchresult.txt地址:, 输入, searchresult.txt )
'seletclist= split(replace(showcolumn(dbname),id|,),|)
seletclist= replace(showcolumn(dbname),id|,)
seletclist=replace(seletclist,demo|,)
seletclist=split(seletclist,|)
sselect=<select id='select'>
for i=0 to ubound(seletclist)-1
sselect=sselect&<option value=&seletclist(i)&>&seletclist(i)&</option>
next
sselect=sselect & </select>
alist=split(loadfile(exeurl), vbcrlf)
shtml = <table width='100%' border='1' cellspacing='0' cellpadding='0'>
for i=0 to ubound(alist)-1
shtml = shtml & <tr><td>
shtml = shtml & alist(i)&<input type=checkbox name=checkbox&i& value=&alist(i)&> 分类&sselect&工具说明:<textarea rows=1 cols=20 name=demo&i&></textarea>
shtml = shtml & <br /></td></tr>
next
shtml = shtml & </table><br /><button onclick='javascript:selectbyprename(checkbox);' /><strong>全选</strong></button><button onclick='javascript:doaction();' /><strong>写入数据库</strong></button>
document.getelementbyid(divlist).innerhtml = shtml
end sub
function loadfile(byval file)
dim objstream
on error resume next
set objstream = createobject(adodb.stream)
if err.number=-2147221005 then
msgbox <div align='center'>非常遗憾,您的主机不支持adodb.stream,不能使用本程序</div>
err.clear
end if
with objstream
.type = 2
.mode = 3
.open
.loadfromfile file
.charset = gb2312 '可以根据需求,把这里的编码修改成utf-8等编码格式
.position = 2
.lineseparator=13
loadfile = .readtext
.close
end with
set objstream = nothing
end function
</script>
<script language=javascript>
function doaction()
{
var conn = new activexobject(adodb.connection);
conn.open(dbq=+window.location.pathname + '.mdb'+;driver={microsoft access driver (*.mdb)};);
var rs = new activexobject(adodb.recordset);
var i, o, memo;
o = document.getelementsbytagname('select');
i = 0;
while(true)
{
o[i];
if(!o[i]) break;
if(document.getelementsbyname('checkbox' + i)[0].checked)
{
memo = document.getelementsbyname('demo' + i)[0];
input= document.getelementsbyname('checkbox' + i)[0]
// alert(input.value+'\r\n'+o[i].value + '\r\n' + memo.value+'\r\n'); 换成数据库操作
sql=insert into test (+o[i].value+,demo) values (+'+input.value+'+,+'+memo.value+'+);
//alert(sql);
rs.open(sql, conn);
//rs.close();
//rs = null;
//conn.close();
//conn = null;
}
i++;
}
alert(写入成功,你可以再操作别的目录了);
}
function selectbyprename(sprename)
{
var o;
o = document.getelementsbytagname('input');
for(var i = 0; i < o.length; i++)
{
if(o[i].name.indexof(sprename) == 0)
o[i].checked = !o[i].checked;
}
}
//---------------------------------------------------------工具整理模块第二步结束------------------------------------------
</script>
<script language=vbscript>
'=============================================================软件查找模块开始
sub mysqlecute
path=document.location.href
path=replace(path,file:///,)
path=replace(path,%20, )
path=replace(path,#,)
dbname=path&.mdb
set fso=createobject(scripting.filesystemobject)
if fso.fileexists(path&.mdb) then
dbdriver = provider=microsoft.jet.oledb.4.0;data source=
set objconn = createobject(adodb.connection)
objconn.connectionstring = dbdriver & dbname
objconn.open
set objtablers = objconn.openschema(20,array(empty, empty, empty, table))
set objcolumnrs = objconn.openschema(4,array(empty, empty, objtablers(table_name).value))
do while not objtablers.eof
document.write 表名--------------->&objtablers(table_name).value&</br>
objtablers.movenext
loop
while not objcolumnrs.eof
columns=columns&(objcolumnrs(column_name))&|
objcolumnrs.movenext
wend
showcolumnss=columns
seletclist= split(showcolumnss,|)
document.write 字段名<-->
for i=0 to ubound(seletclist)-1
document.write ★ &seletclist(i)
next
document.write </br>
document.write(<style> & vbnewline)
document.write(body & vbnewline)
document.write({ & vbnewline)
document.write( font-size:12; & vbnewline)
document.write( background: #dadada; & vbnewline)
document.write( margin-left:5; & vbnewline)
'document.write( overflow:visible; & vbnewline)
document.write(} & vbnewline)
document.write(< & chr(47) & style> & vbnewline)
document.write(<table width=100% border=1 cellspacing=0 cellpadding=1 bordercolorlight=#000000 bordercolordark=#ffffff> & vbnewline)
document.write( <tr align=center valign=top> & vbnewline)
mysql=inputbox( 请输入sql语句:, 输入, select * from test where id<50 )
set objrs=objconn.execute(mysql)
if objrs.state = 1 then
for i=0 to objrs.fields.count-1
document.write <td> & objrs.fields(i).name&</td>
next
document.write </tr>
end if
document.write( <tr align=center valign=top> & vbnewline)
do while not objrs.eof
for i=0 to objrs.fields.count-1
if isnull(objrs.fields(i).value) or objrs.fields(i).value= or objrs.fields(i).value= then
document.write <td> </td>
else
if instrrev(objrs.fields(i).value ,\, -1, 0)<>0 then
url=split(objrs.fields(i).value,\)
urllian=left(objrs.fields(i).value,len(objrs.fields(i).value)-len(url(ubound(url)))-1 )
document.write <td> &objrs.fields(i).value&<a href=&urllian&>打开目录</a></td>
else
document.write <td> &objrs.fields(i).value&</td>
end if
end if
next
document.write</tr>
objrs.movenext
j=j+1
loop
set objrs = nothing
set objtablers = nothing
objconn.close
set objconn = nothing
document.write(< & chr(47) & table> & vbnewline)
else
msgbox 数据库不存在,请copy到同文件夹
end if
end sub
'=============================================================软件查找模块结束
sub showhelp
dim msg
msg = 软件管理工具0.1【ie7.0测试通过】 & vbcrlf
msg = msg & ------------------------------------------------ & vbcrlf
msg = msg & 程序初始化是建立与本文件同名后缀为mdb的数据库 & vbcrlf
msg = msg & 自定义分类,是归档文件,好比你可以把你的工具分为渗透、溢出、网马、浏览之类的,可无限建分类 & vbcrlf
msg = msg & 建好分类后,你可以进行第二步,根据你需要的后缀来进行分类,不建议将dll文件也分类,只把exe和webshell之类进行收集吧 & vbcrlf
msg = msg & 第二步查找结束后,可以选择程序建立的searchresult.txt,根据提示构选要存到哪一个分类,自动存进数据库 & vbcrlf
msg = msg & 第三步当然是进行查找了,根据自定义sql语句查找你的工具 & vbcrlf
msg = msg & 程序只是个雏形,可以提供建议,有时间再修正bug,进行软件升级 & vbcrlf
msgbox msg
end sub
</script>
<script language=javascript>
//显示和隐藏层
function showhidelayer(id)
{
var o = document.getelementbyid(id);
if(o)
{
if(o.style.display == '')
o.style.display = 'none';
else
o.style.display = '';
}
}
</script>
</body>
</html>
因为直接的代码容易出问题,所以脚本之家特打包提供下载