前言
本文记录WebQQ 3.0基于HTTP协议模拟登录过程.
登录概要
登录分为3步.
1.获取验证码.
2.第一次登录.
3.第二次登录.
登录详解
获取验证码
请求方式:GET
请求地址:
http://check.ptlogin2.qq.com/check?uin={0}&appid=1003903&r=0.9982102437527717
{0} QQ号码
返回:
1.不需要验证码
ptui_checkVC('0','!8Z3','{0}');
QQ号码的16进制形式
2.需要验证码
研究中
第一次登陆
请求方式:GET
请求地址:
http://ptlogin2.qq.com/login?u={0}&p={1}&verifycode={2}&webqq_type=10&remember_uin=1&login2qq=1&aid=1003903&u1=http%3A%2F%2Fwebqq.qq.com%2Floginproxy.html%3Flogin2qq%3D1%26webqq_type%3D10&h=1&ptredirect=0&ptlang=2052&from_ui=1&pttype=1&dumy=&fp=loginerroralert&action=4-26-31813&mibao_css=m_webqq&t=1&g=1
{0} QQ号码
{1} 加密后的QQ密码
{2} 第一步得到的验证码
Referer:
http://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%2Fwebqq.qq.com%2Floginproxy.html&f_url=loginerroralert&strong_login=1&login_state=10&t=20120920001
返回:
ptuiCB('0','0','http://web.qq.com/loginproxy.html?login2qq=0&webqq_type=10','0','登录成功!', '{0}');
{0} 昵称
Cookie需保存ptwebqq
第二次登录
请求方式:POST
地址:
http://d.web2.qq.com/channel/login2
POST正文:
r=%7B%22status%22%3A%22online%22%2C%22ptwebqq%22%3A%22{0}%22%2C%22passwd_sig%22%3A%22%22%2C%22clientid%22%3A%22{1}%22%2C%22 psessionid%22%3Anull%7D&clientid={2}&psessionid=null
{0} ptwebqq
{1} clientid
{2} clientid
Referer:
http://d.web2.qq.com/proxy.html?v=20110331002&callback=1&id=3
返回:
{"retcode":0,"result"{"uin":815052562,"cip":2004553643,"index":1073,"port":46272,"status":"online","vfwebqq":"02f124efbab9921e2689a8759f407aa4de0f9fd8269b4e27475278bf76286086ea4a7aa552ef545f","psessionid":"8368046764001e636f6e6e7365727665725f77656271714031302e3132382e36362e3131320000728a000018c8026e040012b794306d0000000a40645a5533366c35776f6d0000002802f124efbab9921e2689a8759f407aa4de0f9fd8269b4e27475278bf76286086ea4a7aa552ef545f","user_state":0,"f":0}}