|
楼主 |
发表于 2014-5-26 16:53
|
显示全部楼层
本帖最后由 kangatang 于 2014-5-27 07:18 编辑
代码示范,以下程序用winsock多次连接服务器,完成139邮箱登录并发送免费手机短信。经测试,快速稳定,无验证码。该程序的源码没有完全公开,网上没有任何可找的线索(除了模拟登录和发送短信)。这是我是原创。也是我第一次用WINSOCK.
dim str, data, volumeRec, frag, JSESSIONID, yourid, yourpwd, relocation, w3code, RMKEY, sid
yourid="13888888888"
yourpwd = "sdfsdf"
Set socket = WScript.CreateObject("MSWinsock.Winsock","Winsock_")
frag = 1
socket.RemoteHost = "XXX.XXX.XXX.XX"
socket.RemotePort = XX
socket.Connect
Do while volumeRec=0 Or socket.State = 9
WScript.Sleep 1000
Loop
checkreturn=Utf8ToUnicode(str)
JSESSIONID = split(split(checkreturn,"JSESSIONID=")(1), ";")(0)
volumeRec=0
frag = 2
if socket.state<> 0 then socket.close
socket.RemoteHost = "YYY.YYY.YYY.YY"
socket.RemotePort = YY
socket.Connect
Do while volumeRec=0 Or socket.State = 9
WScript.Sleep 1000
Loop
checkreturn=Utf8ToUnicode(str)
relocation = trim(split(split(checkreturn,"Location: ")(1), vbCrLf)(0))
relocation = replace(relocation, "XXX.XXX.XXX.XX", "")
w3code = split(split(checkreturn, "__w3code=")(1), ";")(0)
RMKEY = split(split(checkreturn, "RMKEY=")(1), ";")(0)
sid = split(split(relocation, "sid=")(1), "&")(0)
volumeRec=0
frag = 4
if socket.state<> 0 then socket.close
socket.RemoteHost = "YYY.YYY.YYY.YY"
socket.RemotePort = YY
socket.Connect
Do while volumeRec=0 Or socket.State = 9
WScript.Sleep 1000
Loop
Set socket = nothing
WScript.Quit
Sub Winsock_Connect()
select case frag
case 1
data= "GET / HTTP/1.1" & vbCrLf &_
"Host: XXX.XXX.XXX.XX" & vbCrLf &_
"DNT: 1" & vbCrLf & vbCrLf
socket.SendData data
case 2
postdata = "ur=" & yourid & "&pw=" & yourpwd & "&apc=0&_swv=4&switch_ver=3%2C4&adapt_ver=3&client_type=3&_fv=3&clt=3"
data = "POST /index.htm HTTP/1.1" & vbCrLf &_
"Host: XXX.XXX.XXX.XX" & vbCrLf &_
"Connection: keep-alive" & vbCrLf &_
"Cache-Control: max-age=0" & vbCrLf &_
"Content-Length: " & len(postdata) & vbCrLf &_
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" & vbCrLf &_
"Content-Type: application/x-www-form-urlencoded" & vbCrLf &_
"DNT: 1" & vbCrLf &_
"Origin:XXX.XXX.XXX.XX" & vbCrLf &_
"Referer: XXX.XXX.XXX.XX/" & vbCrLf &_
"Accept-Encoding: gzip,deflate,sdch" & vbCrLf &_
"Accept-Language: zh-CN,zh;q=0.8,en;q=0.6" & vbCrLf &_
"Cookie: JSESSIONID=" & JSESSIONID & vbCrLf & vbCrLf & postdata
socket.SendData data
case 4
postdata = "&&sid=" & sid & "&vn=306&cmd=2&content=abc!%40%23&reciever=NNNNNNN&__randomNumber=" & randnumber()
data = "POST /ws12/w3/w3smsend HTTP/1.1" & vbCrLf &_
"Host: XXX.XXX.XXX.XX" & vbCrLf &_
"Connection: Keep-Alive" & vbCrLf &_
"Content-Length: " & len(postdata) & vbCrLf &_
"Origin: XXX.XXX.XXX.XX" & vbCrLf &_
"Content-Type: application/x-www-form-urlencoded;charset=UTF-8" & vbCrLf &_
"Accept: */*" & vbCrLf &_
"DNT: 1" & vbCrLf &_
"Referer: XXX.XXX.XXX.XX/bv12/sendsms.html?&sid=" & sid & "&vn=306&vid=&cmd=40" & vbCrLf &_
"Accept-Encoding: gzip,deflate,sdch" & vbCrLf &_
"Accept-Language: zh-CN,zh;q=0.8,en;q=0.6" & vbCrLf &_
"Cache-Control: no-cache" & vbCrLf &_
"Cookie: __w3code=" & wb3code & "; __wurtype=1; footer_cookie_v_hasv=0; footer_cookies_v_list=3%2C4; footer_cookie_v_clienttype=31 footer_cookie_v_isfromHtml5=0; smsreferurl=" & encodeURI("XXX.XXX.XXX.XX" &lsihv ) & vbCrLf & postdata
socket.SendData data
end select
End Sub
Sub Winsock_DataArrival(bytesTotal)
volumeRec=0
socket.GetData str,,bytesTotal
volumeRec = bytesTotal
End Sub
|
|