字典整理脚本

来源:vbs空间

渗透测试时,好的字典是少不了的
但平时临时添加的字典却是很乱D
需要在原基础上扩展时,就需要整理了

脚本功能:
1.支持拖放!
2.去除重复
3.排序


On Error Resume Next
'Code By NetPatch
Set Arg=Wscript.Arguments
If Arg.Count=0 Then Wscript.Quit
Set Fso = CreateObject("Scripting.FileSystemObject")
Set Conn = CreateObject("ADODB.Connection")
Set Rs = CreateObject("ADODB.Recordset")
path=left(Arg(0),InstrRev(Arg(0),"\"))
Fname=replace(Arg(0),path,"")
Set MyTables = fso.CreateTextFile(arg(0)&".txt",true)
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&path&";Extended

Properties=""text;HDR=NO;FMT=Delimited"""
Rs.Open "Select DISTINCT * FROM " & Fname,_
Conn, 3, 3, &H0001
Do Until Rs.EOF 'N/P
MyTables.WriteLine Rs.Fields.Item(0).Value
Rs.MoveNext
Loop
MyTables.Close
Set MyTables = Nothing
Rs.Close
Conn.Close
Set fso = Nothing
Set Rs = Nothing
Set Conn = Nothing
Wscript.echo "整理完毕!"

相关日志

发表评论