:eek:关于webqq 登录的协议网上已经有很多了;今天特地弄了点时间来写个webqq登录的过程;
web QQ协议 分析
抓包工具: httpwatch
web QQ 数据1。。
当输入QQ号码时,焦点移动到密码框时,这时会给服务器发送一串数据主要是判断当前qq是否需要输入验证码;
发送的数据格式是
https://ssl.ptlogin2.qq.com/check?uin=你的QQ号&appid=1003903&js_ver=10031&js_type=0&login_sig=t4veoNu*GXAvBBUzYXLXpYHwRzgsJbKdlswyCcuuONLwPWj8VCLw1gXQ9fnoZi0D&u1=http%3A%2F%2Fweb.qq.com%2Floginproxy.html&r=0.9447101088450058
下面是抓包工具所抓取;
########################################################
GET /check?uin=1500807270&appid=1003903&js_ver=10031&js_type=0&login_sig=t4veoNu*GXAvBBUzYXLXpYHwRzgsJbKdlswyCcuuONLwPWj8VCLw1gXQ9fnoZi0D&u1=http%3A%2F%2Fweb.qq.com%2Floginproxy.html&r=0.9447101088450058 HTTP/1.1
Accept: */*
Referer: https://ui.ptlogin2.qq.com/cgi-bin/login?target=self&style=5&mibao_css=m_webqq&appid=1003903&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2Fweb.qq.com%2Floginproxy.html&f_url=loginerroralert&strong_login=0&login_state=10&t=20130516001
Accept-Language: zh-CN
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
Accept-Encoding: gzip, deflate
Host: ssl.ptlogin2.qq.com
Connection: Keep-Alive
Cookie:
########################################################
返回数据有两种情况
1.ptui_checkVC('1','2c18e75d3acac5280a8c057e1d07e1ff66e349fd6974a09e','\x00\x00\x00\x00\x59\x74\x80\x66');
2.ptui_checkVC('0','!TXP','\x00\x00\x00\x00\x59\x74\x80\x66');
其中 ‘1’代表需要验证码,‘0’代表不需要验证码 ('!TXP')就是默认的验证码;
获取验证码
https://ssl.captcha.qq.com/getimage?aid=1003903&r=0.04326687619565667&uin=你的QQ号
返回的数据
HTTP/1.1 200 OK
Server: nginx/0.7.67
Date: Mon, 03 Jun 2013 16:37:53 GMT
Content-Type: image/jpeg
Connection: keep-alive
Accept-Ranges: bytes
Pragma: No-cache
P3P: CP=CAO PSA OUR
Content-Length: 2692
Set-Cookie: verifysession=h01ce84b6410a1a8d190d977613ae1cb8c091910377e897fb37db1a9afc031603412b5a3eba8cd9466503d9fa03000a05ba; PATH=/; DOMAIN=qq.com;
其中 cookie: verifysession=h01ce84b6410a1a8d190d977613ae1cb8c091910377e897fb37db1a9afc031603412b5a3eba8cd9466503d9fa03000a05ba; 要保存登录时需要用到的(网上的资料上看到的) 后来我测试的时候,我是没用到这串数据,不知道是什么啥情况:eek:
登录时 ,要发送的数据如下
https://ssl.ptlogin2.qq.com/login?u=你的QQ号&p=(477EE3BBA9C7A642E839ACE55F32C1EE)为加密过的密码&verifycode=(tvte)验证码&webqq_type=10&remember_uin=1&login2qq=1&aid=1003903&u1=http%3A%2F%2Fweb.qq.com%2Floginproxy.html%3Flogin2qq%3D1%26webqq_type%3D10&h=1&ptredirect=0&ptlang=2052&from_ui=1&pttype=1&dumy=&fp=loginerroralert&action=2-17-15730&mibao_css=m_webqq&t=1&g=1&js_type=0&js_ver=10031&login_sig=a27Ga1qNTG6ldZNIXhgJJrSHeBBw-OQBmso*pQURbTJcfZ9jNZM3Nk7Hb8ffP9fB
########################################################
QQ密码加密方式为(参考网上资料)
MD5(hexchar2bin(MD5(密码))+pt.uin)+大写验证码); pt.uin === \x00\x00\x00\x00\x59\x74\x80\x66
其中 \x00\x00\x00\x00\x59\x74\x80\x66 就等于 0000000059748066 此为16进制数 转换成10进制数就是你的QQ号码;
########################################################
登录成功后返回的数据
ptuiCB('0','0','http://web.qq.com/loginproxy.html?login2qq=1&webqq_type=10','0','登录成功!', 'Jyw');
附件中只写了登录过程,比较简单,代码很烂,大牛飘过;
web QQ协议 分析
抓包工具: httpwatch
web QQ 数据1。。
当输入QQ号码时,焦点移动到密码框时,这时会给服务器发送一串数据主要是判断当前qq是否需要输入验证码;
发送的数据格式是
https://ssl.ptlogin2.qq.com/check?uin=你的QQ号&appid=1003903&js_ver=10031&js_type=0&login_sig=t4veoNu*GXAvBBUzYXLXpYHwRzgsJbKdlswyCcuuONLwPWj8VCLw1gXQ9fnoZi0D&u1=http%3A%2F%2Fweb.qq.com%2Floginproxy.html&r=0.9447101088450058
下面是抓包工具所抓取;
########################################################
GET /check?uin=1500807270&appid=1003903&js_ver=10031&js_type=0&login_sig=t4veoNu*GXAvBBUzYXLXpYHwRzgsJbKdlswyCcuuONLwPWj8VCLw1gXQ9fnoZi0D&u1=http%3A%2F%2Fweb.qq.com%2Floginproxy.html&r=0.9447101088450058 HTTP/1.1
Accept: */*
Referer: https://ui.ptlogin2.qq.com/cgi-bin/login?target=self&style=5&mibao_css=m_webqq&appid=1003903&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2Fweb.qq.com%2Floginproxy.html&f_url=loginerroralert&strong_login=0&login_state=10&t=20130516001
Accept-Language: zh-CN
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
Accept-Encoding: gzip, deflate
Host: ssl.ptlogin2.qq.com
Connection: Keep-Alive
Cookie:
########################################################
返回数据有两种情况
1.ptui_checkVC('1','2c18e75d3acac5280a8c057e1d07e1ff66e349fd6974a09e','\x00\x00\x00\x00\x59\x74\x80\x66');
2.ptui_checkVC('0','!TXP','\x00\x00\x00\x00\x59\x74\x80\x66');
其中 ‘1’代表需要验证码,‘0’代表不需要验证码 ('!TXP')就是默认的验证码;
获取验证码
https://ssl.captcha.qq.com/getimage?aid=1003903&r=0.04326687619565667&uin=你的QQ号
返回的数据
HTTP/1.1 200 OK
Server: nginx/0.7.67
Date: Mon, 03 Jun 2013 16:37:53 GMT
Content-Type: image/jpeg
Connection: keep-alive
Accept-Ranges: bytes
Pragma: No-cache
P3P: CP=CAO PSA OUR
Content-Length: 2692
Set-Cookie: verifysession=h01ce84b6410a1a8d190d977613ae1cb8c091910377e897fb37db1a9afc031603412b5a3eba8cd9466503d9fa03000a05ba; PATH=/; DOMAIN=qq.com;
其中 cookie: verifysession=h01ce84b6410a1a8d190d977613ae1cb8c091910377e897fb37db1a9afc031603412b5a3eba8cd9466503d9fa03000a05ba; 要保存登录时需要用到的(网上的资料上看到的) 后来我测试的时候,我是没用到这串数据,不知道是什么啥情况:eek:
登录时 ,要发送的数据如下
https://ssl.ptlogin2.qq.com/login?u=你的QQ号&p=(477EE3BBA9C7A642E839ACE55F32C1EE)为加密过的密码&verifycode=(tvte)验证码&webqq_type=10&remember_uin=1&login2qq=1&aid=1003903&u1=http%3A%2F%2Fweb.qq.com%2Floginproxy.html%3Flogin2qq%3D1%26webqq_type%3D10&h=1&ptredirect=0&ptlang=2052&from_ui=1&pttype=1&dumy=&fp=loginerroralert&action=2-17-15730&mibao_css=m_webqq&t=1&g=1&js_type=0&js_ver=10031&login_sig=a27Ga1qNTG6ldZNIXhgJJrSHeBBw-OQBmso*pQURbTJcfZ9jNZM3Nk7Hb8ffP9fB
########################################################
QQ密码加密方式为(参考网上资料)
MD5(hexchar2bin(MD5(密码))+pt.uin)+大写验证码); pt.uin === \x00\x00\x00\x00\x59\x74\x80\x66
其中 \x00\x00\x00\x00\x59\x74\x80\x66 就等于 0000000059748066 此为16进制数 转换成10进制数就是你的QQ号码;
########################################################
登录成功后返回的数据
ptuiCB('0','0','http://web.qq.com/loginproxy.html?login2qq=1&webqq_type=10','0','登录成功!', 'Jyw');
附件中只写了登录过程,比较简单,代码很烂,大牛飘过;