hta编写的软件管理工具0.1(IE7.0测试通过)

脚本专栏 hta 分类:[default] 更新日期: 2016-03-09
程序初始化是建立与本文件同名后缀为mdb的数据库
自定义分类,是归档文件,好比你可以把你的工具分为渗透、溢出、网马、浏览之类的,可无限建分类
建好分类后,你可以进行第二步,根据你需要的后缀来进行分类,不建议将dll文件也分类,只把exe和webshell之类进行收集吧
第二步查找结束后,可以选择程序建立的SearchResult.txt,根据提示构选要存到哪一个分类,自动存进数据库
第三步当然是进行查找了,根据自定义sql语句查找你的工具
程序只是个雏形,可以提供建议,有时间再修正bug,进行软件升级
代码如下:

<HTML>
<HEAD>
<HTA:Application
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 ></div>
<div 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 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 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" >
<div style="position: absolute; top: 30px; left: 3px; width: 3; height: 2; z-index: 4" >
<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" >
<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" >
<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>

因为直接的代码容易出问题,所以特打包提供下载
下载地址:http://xiazai.jb51.net/200905/other/tools_hta.rar

> 本站内容系网友提交或本网编辑转载,其目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如涉及作品内容、版权和其它问题,请及时与本网联系,我们将在第一时间删除内容!

相关文章
  • CSS3实现动态翻牌效果仿百度贴吧3D翻牌一次动画特效
    CSS3实现动态翻牌效果仿百度贴吧3D翻牌一次动画特效
    本文主要分享一个利用CSS3新特性transform,实现3D翻牌的特效,有需要的小伙伴可以参考下.今天分享一个CSS3制作的翻牌效果,效果如下图所示,所过把把这个效果应用于相册肯定会很炫的.呵呵,超酷啊. 一.HTML代码: 因为是CSS3实现,所以大家可以看到没有任何的JS代码.ul为一组图片,每个li中有个a(因为我们希望可以跳转),a中包含两个div ...
  • 关于图片存储格式的整理(JPEG格式介绍)
    这篇文章主要介绍了关于图片存储格式的整理JPEG,需要的朋友可以参考下JPG jpg全名是JPEG .JPEG 图片以 24 位颜色存储单个光栅图像.JPEG 是与平台无关的格式,支持最高级别的压缩,不过,这种压缩是有损耗的.渐近式 JPEG 文件支持交错. jpg功能 可以提高或降低 JPEG文件压缩的级别.但是,文件大小是以牺牲图像质量为代价的.压缩比率 ...
  • 关于IE11修改User-agent不再支持document.all等
    这篇文章主要介绍了关于IE11修改User-agent不再支持document.all等,需要的朋友可以参考下一个新的身份标识关于IE11的第一个新闻就是它有了一个新的用户代理(UA)字符串: Mozilla/5.0 (IE 11.0; Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C; rv:11.0) lik ...
  • Web2.0编程思想:16条法则
    1.在你开始之前,先定一个简单的目标.无论你是一个Web 2.0应用的创建者还是用户,请清晰的构思你的目标.就像"我需要保存一个书签"或者"我准备帮助人们创建可编辑的.共享的页面"这样的目标,让你保持最基础的需求.很多Web 2.0应用的最初吸引之处就是它的简单,避免并隐藏了那些多余的复杂性.站在创建者的立场,可以想象 ...
  • 解读ASP.NET5&MVC6系列教程1:ASP.NET5简介
    这篇文章主要介绍ASP.NET 5简介以及对各个版本号进行解释,ASP.NET 5中新的变化,需要的朋友可以参考下.ASP.NET 5简介 ASP.NET 5是一个跨时代的改写,所有的功能和模块都进行了独立拆分,做到了彻底解耦.为了这些改写,微软也是蛮 拼的,几乎把.NET Framwrok全部改写了一遍,形成了一个.NET Core的东西. 在.NET C ...
  • MongoDB的Master-Slave主从模式配置及主从复制要点解析
    主从复制是数据库运维中一种常见的备份方式,这里我们来看一下MongoDB的Master-Slave主从模式配置及主从复制要点解析,需要的朋友可以参考下主从配置mongodb的master-slave模式配置方式如下1.keyFile生成key_file openssl rand -base64 741 > mongo_key 将mongo_key 分别 ...
猜你喜欢