防止出现不能访问网页
发表于 2012-6-5 10:03:21
此贴集中最新的WEBQQ协议 1、制作QQ机器人前的准备 2、检查QQ--分析qq协议1 3、QQ协议新加密方式详细说明 4、登陆之获取验证码图片 5、第一次登陆---验证QQ密码 6、第二次登陆--真正的上线 7、获取QQ好友列表 8、获取个人信息 9、获取QQ群列表 10、接受QQ消息--POLL长等待 11、发送QQ好友消息 12、发送QQ群消息 |
我们可能已经发现网络上已经出现了很多QQ机器人,QQ群发器等相关的文章,其实我们在使用别人软件的时候,总觉得功能不是那么的完全适合我们自己的要求,为此更多的人想自己制作一个属于自己的QQ机器人。
不管怎么说,制作QQ机器人必须去探索QQ官网的数据包,在这里我们称之为QQ协议,其实更准确的说它就是一个通讯协议。所以我们在制作QQ机器人之前必须有如下的准备:
1、抓包软件:我个人用的HttpAnalyzerFullTrial_V6,其他像WPE也可以,个人喜欢是最重要的。
2、开发语言:这个就靠自己的兴趣爱好了,有人会JAVA,有人会C#,初学者更多的会E语言或者VB啥的,当然我一直喜欢DELPHI,不管怎么说吧,只要会一种开发语言就可以了。
3、了解GET,POST方式提交,COOKIES、Referer,UTF8编码等等,这些如果不熟悉,之后的有一段时间里,如果你经常访问Q协网你会慢慢得到理解。
直接进入正题,我们说,制作QQ机器人第一步首先是登陆QQ机器人,在登陆的时候朋友们肯定遇到过很多问题,有些问题甚至百思不得其解,这个时候怎么办?(插条广告)到Q协论坛:http://bbs.qqxieyi.com
首先,看题目,我们说检查QQ,大家想想为什么腾讯要检查QQ,很简单,为了安全!当我们的QQ号是错误的或者异地登陆,这一步会返回一个信息,让我们去获取验证码,当然我们这里所说的验证码是图片验证码,其实如果QQ号码没有异常,这一步会直接返回一个文字验证码,就不需要用户去识别了,我们也不需要再去获取图片验证码,直接登录就行。
言归正传,我们使用抓包软件,并访问WEBQQ官网:http://web.qq.com
开启抓包软件,我们在这个地方输入我们QQ号码,然后鼠标点到密码框,让QQ号码框失去焦点。接着暂停转包,我们来看看刚刚这一步都抓到了什么包....
http://check.ptlogin2.qq.com/check?uin=1019955269&appid=1003903&r=0.6331230279734363
这个包的提交方式是GET方式,基础不好朋友可以先去百度一下什么是GET方式,什么是POST方式。我们看看URL里面有我们QQ号码1019955269,后面1003903是腾讯的应用码,这个参数不会变我们不用管,最后一个小数点,这是一个随机数,如果做程序懒得写代码,那我们也固定它吧,保持不变就行。
看看提交这个URL之后,腾讯返回了什么
ptui_checkVC('0','!FNJ', '\x00\x00\x00\x00\x3c\xcb\x48\x45');
说明一下,ptui_checkVC不用管它,我们关心的是参数,第一个参数0,表示检查QQ没有异常,如果不是0说明我们要去获取图片验证码,这个以后再说;第二个参数!FNJ,他就是我们的文字验证码,留着我们登陆需要他;第三个参数\x00\x00\x00\x00\x3c\xcb\x48\x45这个是一个说明,需要转码才知道,我想大概就是说QQ无异常吧,这个不是很确定,说错了别笑我哈,总之这个反正也没多大用。
再看看返回的COOKIES,一共2个,分别是ptvfsession和confirmuin,他们的值比较的长:
ptvfsession:6333ed26e8cb040cfe0b3e82fcfe91941fe83e8bc07af4ed53044f534842485faacc0e6cdc4fbd6b4bfd9baa010ef1d7
confirmuin:1019955269
COOKIES都要留着,在之后登陆提交时,需要附上!
好了今天就到这里,谢谢大家访问Q协网!
首先纠正之前一篇文章的一个错误,http://www.qqxieyi.com/fenxi_show.asp?id=15 这篇文章的第三个参数'\x00\x00\x00\x00\x3c\xcb\x48\x45',其实是有用处的,在新的加密方式中不可少!
那么这个参数是什么呢?其实是我们QQ号码的16进制形式,我上次演示QQ号为:1019955269,我们把\x00\x00\x00\x00\x3c\xcb\x48\x45中的\x去掉之后就剩下000000003ccb4845,我们用计算器转换一下这个数为10进制,便是1019955269
新的加密方式具体实现如下:
本帖隐藏的内容
先看这一段代码,腾讯加密JS的源代码(comm.js)M=C.p.value;var I=hexchar2bin(md5(M));var H=md5(I+pt.uin);var G=md5(H+C.verifycode.value.toUpperCase())
整理之后为 结果=MD5(MD5(hexchar2bin(MD5(密码))+pt.uin)+大写验证码)
主要问题在pt.uin,我们将\x00\x00\x00\x00\x3c\xcb\x48\x45分为00 00 00 00 3c cb 48 45
然后对每组16进制数字转换成ASCII字符,然后连接起来就是pt.uin
以Delphi为例:
pt.uin为char(strtoint('$00'))+char(strtoint('$00'))+char(strtoint('$00'))+char(strtoint('$00'))+char(strtoint('$3c'))+char(strtoint('$cb'))+char(strtoint('$48'))+char(strtoint('$45'))
测试数据:
pt_uin:\x00\x00\x00\x00\x3c\xcb\x48\x45
密码:123456
验证码:EKWJ
结果:4C96D2E3E2FEA945F6D54F98323FA412
从检查QQ那一步,地址http://check.ptlogin2.qq.com/check?uin=1019955269&appid=1003903&r=0.9014809025383771
返回的结果
ptui_checkVC('1','5996320311ead973fa948d043b2f085959875144fb277c5a', '\x00\x00\x00\x00\x3c\xcb\x48\x45');
第一个参数是1,说而不是0,说明我要去获取图片验证码
获取图片验证码如下:
本帖隐藏的内容
地址: http://captcha.qq.com/getimage?aid=1003903&r=0.45623475915069394&uin=1019955269提交方式:GET
aid不变,r为随机数,也可以不变,uin是QQ号
COOKIES:将检查QQ那一步返回的QQ附上,同时获取图片验证码这一步会返回verifysession的COOIKE,注意保存!
提交之后就会返回验证码图片
本帖隐藏的内容
经过之前的检查QQ和验证码获取之后,我们现在开始验证密码,称之为第一次登陆,这次登陆不会使在线的QQ踢下线。检查QQ密码是否正确。。操作如下:
地址: http://ptlogin2.qq.com/login?u=1019955269&p=B95F5109BC626E4E5547AE637F5B87B3&verifycode=EKWJ&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=3-27-27672&mibao_css=m_webqq&t=1&g=1
提交方式:GET
参数说明:u为QQ号;p为新加密方式密文,论坛有讲解;verifycode为验证码,注意全部是大写字母;其他参数保持不变即可
COOKIES:将之前几步的COOKIES都附上
返回内容:
ptuiCB('0','0','http://web.qq.com/loginproxy.html?login2qq=1&webqq_type=10','0','登录成功!', '嗳(_灬謊√恋');
第一个参数为0说明正确,不为0则第三个参数会返回错误提示
返回的COOKIES:比较多,这里就不一一举例,特别是skey在QQ空间的时候需要那他来做GTK
当密码验证没有问题之后,登陆WEBQQ就差这一步了,这一步许多新手会出现各种各样的问题,各种不成功,各种蛋疼!
仔细看好下面的操作,这次操作会将已经在线的QQ强制踢下线。。。。
本帖隐藏的内容
地址: http://d.web2.qq.com/channel/login2提交方式:POST
POST参数:
r={"status":"online","ptwebqq":"a6b9672bccf1ff55eca7ad3d8e87061645f64a3c2a69fb7216cb75a488357821","passwd_sig":"","clientid":"99742312","psessionid":null}
clientid=99742312
psessionid=null
r是一个JSON,里面包含了登录时的参数。status是登陆状态在线、隐身等;ptwebqq是第一次登陆返回的COOKIES里面的一个值。passwd_sig没用;clientid是客户端ID,这是一个随即数,保持不变即可,但要注意:后面发消息等操作所有的clientid都得相同。psessionid为null
常见的一些问题原因:
1、COOKIES没附上
2、Referer没写,注意是http://d.web2.qq.com/proxy.html?v=20110331002&callback=2
3、参数没有编码,注意是UTF8格式,所有URL必需进行HTTP编码
4、其他问题可以抓自己写的软件发出的包,然后仔细比对WEBQQ原数据
登陆成功之后会返回
{"retcode":0,"result":{"uin":1019955269,"cip":3663625271,"index":1074,"port":51529,"status":"online","vfwebqq":"63551464f3b279f77756ba6c15addcd62a376c5f9b014f7dc959732faaf02c4f7a02a3162896bb82","psessionid":"8368046764001e636f6e6e7365727665725f77656271714031302e3132382e36362e313135000038da00001765026e04004548cb3c6d0000000a4031464e4d70336d6c786d0000002863551464f3b279f77756ba6c15addcd62a376c5f9b014f7dc959732faaf02c4f7a02a3162896bb82","user_state":0,"f":0}}
他是一个JOSN, 我们记得保存两个重要的值vfwebqq和psessionid,他们是登陆令牌,后续操作都需用到他们!
第二次登陆成功之后,万恶的WEBQQ已经被你拿下大片江山,以后操作将非常简单,拿上我们的登陆令牌去邪恶吧
获取QQ好友列表
操作如下:
本帖隐藏的内容
地址: http://s.web2.qq.com/api/get_user_friends2提交方式:post
POST参数:
r={"h":"hello","vfwebqq":"63551464f3b279f77756ba6c15addcd62a376c5f9b014f7dc959732faaf02c4f7a02a3162896bb82"}
h固定,vfwebqq为登陆令牌
注意COOKIES和REFERER以后不再说明
返回结果:
{"retcode":0,"result":{"friends":[{"flag":4,"uin":153654585,"categories":1},{"flag":4,"uin":3246751537,"categories":1},{"flag":0,"uin":478094726,"categories":0},{"flag":0,"uin":3270416256,"categories":0},{"flag":4,"uin":1733120926,"categories":1},{"flag":4,"uin":597192957,"categories":1},{"flag":0,"uin":4156840160,"categories":0},{"flag":0,"uin":1361051155,"categories":0},{"flag":0,"uin":3643068668,"categories":0},{"flag":0,"uin":2090492687,"categories":0},{"flag":0,"uin":994983118,"categories":0}],"marknames":[{"uin":1741704764,"markname":"1001"},{"uin":1304418790,"markname":"1111111111111111111111"}],"categories":[{"index":1,"sort":1,"name":"朋友"},{"index":2,"sort":2,"name":"家人"},{"index":3,"sort":3,"name":"同学"}],"vipinfo":[{"vip_level":7,"u":153654585,"is_vip":1},{"vip_level":0,"u":3246751537,"is_vip":0},{"vip_level":0,"u":478094726,"is_vip":0},{"vip_level":0,"u":3270416256,"is_vip":0},{"vip_level":0,"u":1733120926,"is_vip":0},{"vip_level":6,"u":597192957,"is_vip":1},{"vip_level":6,"u":4156840160,"is_vip":1},{"vip_level":0,"u":1361051155,"is_vip":0},{"vip_level":0,"u":3643068668,"is_vip":0},{"vip_level":0,"u":2090492687,"is_vip":0},{"vip_level":0,"u":994983118,"is_vip":0}],"info":[{"face":0,"flag":289964614,"nick":"Silvan冷雨海","uin":153654585},{"face":405,"flag":524802,"nick":" ____湯 、","uin":3246751537},{"face":336,"flag":298320384,"nick":" 新鲜.","uin":478094726},{"face":597,"flag":8388608,"nick":"一种困惑","uin":3270416256},{"face":693,"flag":17302114,"nick":"▓伦敦大桥上的小挂念","uin":1733120926},{"face":0,"flag":17334854,"nick":"哥′牛粪一坨","uin":597192957},{"face":270,"flag":298353222,"nick":"小酷","uin":4156840160},{"face":0,"flag":8388608,"nick":"卧龙传说","uin":1361051155},{"face":477,"flag":8389120,"nick":" 特工?008","uin":3643068668},{"face":555,"flag":0,"nick":"[常年收ip]2w站","uin":2090492687},{"face":558,"flag":8388608,"nick":"机器人","uin":994983118}]}}
关于JOSN结构,以后再讲,不会的朋友可以先去百度。
里面几个关键词说明一下:friends是好友列表,flag是在线状态,uin是临时QQ码,注意不是QQ号!,markname是好友备注名,categories是好友分类组。
vipinfo是会员信息,categories是好友分类信息
获取个人信息,包括生日,昵称,个性签名,生肖,email,手机,电话,地址等
地址:http://s.web2.qq.com/api/get_friend_info2?tuin=1019955269&verifysession=&code=&vfwebqq=63551464f3b279f77756ba6c15addcd62a376c5f9b014f7dc959732faaf02c4f7a02a3162896bb82&t=1338859742796
方式:GET
返回:
{"retcode":0,"result":{"face":0,"birthday":{"month":3,"year":1989,"day":21},"occupation":"","phone":"","allow":1,"college":"","reg_time":0,"uin":1019955269,"constel":3,"blood":0,"homepage":"","stat":10,"vip_info":0,"country":"中国","city":"南京","personal":"这一年 遇见了你\r\n是幸还是不幸 我已无力深究","nick":"嗳(_灬謊√恋","shengxiao":10,"email":"","client_type":41,"province":"江苏","gender":"male","mobile":""}}
本帖隐藏的内容地址: http://s.web2.qq.com/api/get_group_name_list_mask2方式:POST 提交参数: r = {"vfwebqq":"63551464f3b279f77756ba6c15addcd62a376c5f9b014f7dc959732faaf02c4f7a02a3162896bb82"} 返回 {"retcode":0,"result":{"gmasklist":[],"gnamelist":[{"flag":1041,"name":"Q协网1号群","gid":1741704764,"code":538779280},{"flag":184550417,"name":"学院-2011-新生群","gid":1024710259,"code":345088435}],"gmarklist":[{"uin":1741704764,"markname":"1001"}]}} 一看就明白没什么好说的 |
地址:http://d.web2.qq.com/channel/poll2本帖隐藏的内容方式:POST提交参数:(3个) clientid = 99742312 psessionid = 8368046764001e636f6e6e7365727665725f77656271714031302e3132382e36362e313135000038da00001765026e04004548cb3c6d0000000a4031464e4d70336d6c786d0000002863551464f3b279f77756ba6c15addcd62a376c5f9b014f7dc959732faaf02c4f7a02a3162896bb82 r = {"clientid":"99742312","psessionid":"8368046764001e636f6e6e7365727665725f77656271714031302e3132382e36362e313135000038da00001765026e04004548cb3c6d0000000a4031464e4d70336d6c786d0000002863551464f3b279f77756ba6c15addcd62a376c5f9b014f7dc959732faaf02c4f7a02a3162896bb82","key":0,"ids":[]} psessionid为令牌;clientid为客户端ID 返回结果 {"retcode":0,"result":[{"poll_type":"group_message","value":{"msg_id":148,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":966729,"msg_type":43,"reply_ip":176752341,"group_code":345088435,"send_uin":1552311252,"seq":919698,"time":1338859714,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u7334\u7334 \u82E5\u6709\u5192\u72AF \u6211\u9053\u6B49\u4E0B\u54C8 "]}},{"poll_type":"group_message","value":{"msg_id":23207,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":21243,"msg_type":43,"reply_ip":176881777,"group_code":345088435,"send_uin":3620961896,"seq":919697,"time":1338859704,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],["face",74],"\u8BA4\u8BC6\u5C31\u8BF7\u6211\u5403\u996D\uFF1F "]}},{"poll_type":"group_message","value":{"msg_id":23207,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":21243,"msg_type":43,"reply_ip":176881777,"group_code":345088435,"send_uin":3620961896,"seq":919697,"time":1338859704,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],["face",74],"\u8BA4\u8BC6\u5C31\u8BF7\u6211\u5403\u996D\uFF1F "]}},{"poll_type":"group_message","value":{"msg_id":23206,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":602179,"msg_type":43,"reply_ip":176752236,"group_code":345088435,"send_uin":3620961896,"seq":919696,"time":1338859696,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],["face",74],"\u6CA1\u5173\u7CFB\uFF0C\u91C7\u82B1\u6735\u513F\u5F88\u597D\u73A9 "]}},{"poll_type":"group_message","value":{"msg_id":245,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":524930,"msg_type":43,"reply_ip":176752236,"group_code":345088435,"send_uin":1566433914,"seq":919695,"time":1338859681,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],["face",10],"\u4E0D\u600E\u6837 "]}},{"poll_type":"group_message","value":{"msg_id":23205,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":74707,"msg_type":43,"reply_ip":176498314,"group_code":345088435,"send_uin":3620961896,"seq":919694,"time":1338859670,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u54FC\uFF0C\u8BA4\u8BC6\u600E\u6837 "]}},{"poll_type":"group_message","value":{"msg_id":42322,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452697,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":459546968,"seq":2292,"time":1338823936,"info_seq":85195768,"content":[["font",{"size":10,"color":"ff0080","style":[1,0,0],"name":"\u5B8B\u4F53"}],"\u6211\u5728\u542C\u4E00\u9996\u6B4C\r\u592A\u641E\u7B11\u4E86\r",["face",13],"\r\u8981\u4E0D\u8981\u542C\rhttp://www.chadu168.com:885/song/201205/xiaomosaomai.mp3\r\u4F60\u542C\u4E0B\r\u7B11\u6B7B\u6211\u4E86\r "]}},{"poll_type":"group_message","value":{"msg_id":42312,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452474,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":459546968,"seq":2282,"time":1338819262,"info_seq":85195768,"content":[["font",{"size":10,"color":"ff0080","style":[1,0,0],"name":"\u5B8B\u4F53"}],"01.var \r02. SS: String; \r03. \r04.procedure test1(const s: String); \r05.begin \r06. try \r07. SS := \u0027\u4F60\u597D\u0027; \r08. ShowMessage(s); \r09. except \r10. end; \r11.end; \r12. \r13.procedure TfrmMain.btnTestClick(Sender: TObject); \r14.begin \r15. SS := \u0027Hello\u0027; \r16. test1(SS); \r17.end; \r\u4F1A\u663E\u793A\u4EC0\u4E48\uFF1F\r "]}},{"poll_type":"group_message","value":{"msg_id":42331,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452344,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":749437219,"seq":2301,"time":1338824335,"info_seq":85195768,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5FAE\u8F6F\u96C5\u9ED1"}],["cface",{"name":"{AD082EA1-4884-7EC0-D26D-A63411CF9624}.gif","file_id":1027148361,"key":"ppwkvYftCUvu4EXg","server":"124.115.1.215:443"}]," "]}},{"poll_type":"group_message","value":{"msg_id":42330,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452343,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":579531591,"seq":2300,"time":1338824314,"info_seq":85195768,"content":[["font",{"size":9,"color":"0000ff","style":[0,0,0],"name":"\u5B8B\u4F53"}],["face",73]," "]}},{"poll_type":"group_message","value":{"msg_id":42329,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452342,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":579531591,"seq":2299,"time":1338824308,"info_seq":85195768,"content":[["font",{"size":9,"color":"0000ff","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u6D9B\u6D9B\uFF0CPC\uFF12\uFF10\uFF11\uFF12\u534F\u8BAE\u6709\u7814\u7A76\u6CA1\n "]}},{"poll_type":"group_message","value":{"msg_id":42328,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452341,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":459546968,"seq":2298,"time":1338824307,"info_seq":85195768,"content":[["font",{"size":10,"color":"ff0080","style":[1,0,0],"name":"\u5B8B\u4F53"}],"\u89C9\u5F97\u6709\u610F\u601D "]}},{"poll_type":"group_message","value":{"msg_id":42327,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452340,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":459546968,"seq":2297,"time":1338824299,"info_seq":85195768,"content":[["font",{"size":10,"color":"ff0080","style":[1,0,0],"name":"\u5B8B\u4F53"}],"\u7B2C\u4E00\u6B21\u542C\u8FD9\u79CD\u6B4C "]}},{"poll_type":"group_message","value":{"msg_id":42326,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452339,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":459546968,"seq":2296,"time":1338824294,"info_seq":85195768,"content":[["font",{"size":10,"color":"ff0080","style":[1,0,0],"name":"\u5B8B\u4F53"}],"\u662F\u554A "]}},{"poll_type":"group_message","value":{"msg_id":42325,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452338,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":579531591,"seq":2295,"time":1338824268,"info_seq":85195768,"content":[["font",{"size":9,"color":"0000ff","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u5531\u8FD9\u4E2A\u7684\u725BB "]}},{"poll_type":"group_message","value":{"msg_id":42324,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452337,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":166181774,"seq":2294,"time":1338824177,"info_seq":85195768,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],["face",97]," "]}},{"poll_type":"group_message","value":{"msg_id":42323,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452336,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":579531591,"seq":2293,"time":1338824107,"info_seq":85195768,"content":[["font",{"size":9,"color":"0000ff","style":[0,0,0],"name":"\u5B8B\u4F53"}],["face",134]," "]}},{"poll_type":"group_message","value":{"msg_id":42321,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452335,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":579531591,"seq":2291,"time":1338823922,"info_seq":85195768,"content":[["font",{"size":9,"color":"0000ff","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u673A\u5668\u4EBA\u4E0D\u80FD\u63A5\u6536\u591A\u884C\u6D88\u606F\uFF0C\u7B97\u4E0D\u7B97\u6B63\u5E38\u5440 "]}},{"poll_type":"group_message","value":{"msg_id":42320,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452334,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":4156840160,"seq":2290,"time":1338820882,"info_seq":85195768,"content":[["font",{"size":14,"color":"ff0000","style":[1,0,0],"name":"\u9ED1\u4F53"}],"\u7B49\u6211\u6587\u7AE0 "]}},{"poll_type":"group_message","value":{"msg_id":42319,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452333,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":2801185498,"seq":2289,"time":1338820779,"info_seq":85195768,"content":[["font",{"size":12,"color":"000000","style":[0,0,0],"name":"\u5FAE\u8F6F\u96C5\u9ED1"}],"\u8BBA\u575B\u90FD\u6CA1\u4EC0\u4E48\u4EBA\u3002\u3002 "]}},{"poll_type":"group_message","value":{"msg_id":42318,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452332,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":459546968,"seq":2288,"time":1338820750,"info_seq":85195768,"content":[["font",{"size":10,"color":"ff0080","style":[1,0,0],"name":"\u5B8B\u4F53"}],"\u6CA1DELPHI\u7684\uFF1F "]}},{"poll_type":"group_message","value":{"msg_id":42317,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452331,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":4156840160,"seq":2287,"time":1338820745,"info_seq":85195768,"content":[["font",{"size":14,"color":"ff0000","style":[1,0,0],"name":"\u9ED1\u4F53"}],"\u53D1\u8BBA\u575B\u53BB "]}},{"poll_type":"group_message","value":{"msg_id":42316,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452330,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":2801185498,"seq":2286,"time":1338820740,"info_seq":85195768,"content":[["font",{"size":12,"color":"000000","style":[0,0,0],"name":"\u5FAE\u8F6F\u96C5\u9ED1"}],"\u534F\u8BAE "]}},{"poll_type":"group_message","value":{"msg_id":42315,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452329,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":2801185498,"seq":2285,"time":1338820735,"info_seq":85195768,"content":[["font",{"size":12,"color":"000000","style":[0,0,0],"name":"\u5FAE\u8F6F\u96C5\u9ED1"}],"\u597D\u50CF\u662FQQ2005\u7684 "]}},{"poll_type":"group_message","value":{"msg_id":42314,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452327,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":2801185498,"seq":2284,"time":1338820713,"info_seq":85195768,"content":[["font",{"size":12,"color":"000000","style":[0,0,0],"name":"\u5FAE\u8F6F\u96C5\u9ED1"}],"\u627E\u5230\u4E2A\u6279\u91CF\u6302\u673AC#\u6E90\u7801\uFF08\u5305\u542BQQ\u534F\u8BAE\uFF09\uFF0C\u6709\u5174\u8DA3\u7684\u7814\u7A76\u7814\u7A76 "]}},{"poll_type":"group_message","value":{"msg_id":42313,"from_uin":1741704764,"to_uin":1019955269,"msg_id2":452326,"msg_type":43,"reply_ip":176752209,"group_code":538779280,"send_uin":459546968,"seq":2283,"time":1338819266,"info_seq":85195768,"content":[["font",{"size":10,"color":"ff0080","style":[1,0,0],"name":"\u5B8B\u4F53"}],["face",81]," "]}},{"poll_type":"group_message","value":{"msg_id":135,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":36299,"msg_type":43,"reply_ip":176498314,"group_code":345088435,"send_uin":3721566410,"seq":919693,"time":1338859659,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u7334\u7334\u4EE5\u540E\u5C0F\u5FC3\u4E86 "]}},{"poll_type":"group_message","value":{"msg_id":35108,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886149,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":1566433914,"seq":919692,"time":1338859656,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u7334\u5B50\u8FD8\u8BA4\u8BC6\u6211\u4E0D",["face",76]," "]}},{"poll_type":"group_message","value":{"msg_id":35107,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886148,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":1566433914,"seq":919691,"time":1338859644,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u800D\u7334",["face",57]," "]}},{"poll_type":"group_message","value":{"msg_id":35106,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886147,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":3620961896,"seq":919690,"time":1338859637,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],["face",55]," "]}},{"poll_type":"group_message","value":{"msg_id":35105,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886146,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":1566433914,"seq":919689,"time":1338859634,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],["face",85]," "]}},{"poll_type":"group_message","value":{"msg_id":35104,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886145,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":3721566410,"seq":919688,"time":1338859634,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u7889\u5821\u4E86 "]}},{"poll_type":"group_message","value":{"msg_id":35103,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886144,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":3721566410,"seq":919687,"time":1338859613,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],["face",1]," "]}},{"poll_type":"group_message","value":{"msg_id":35102,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886143,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":1552311252,"seq":919686,"time":1338859601,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u6211\u800D\u7334\u4E13\u4E1A\u7684 "]}},{"poll_type":"group_message","value":{"msg_id":35101,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886142,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":3620961896,"seq":919685,"time":1338859575,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u6728\u610F\u601D\u3002\u90FD\u4E0D\u597D\u73A9 "]}},{"poll_type":"group_message","value":{"msg_id":35100,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886141,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":3620961896,"seq":919684,"time":1338859547,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],["face",111],"\u4F60\u8F6C\u672C\u5B66\u4EC0\u4E48\uFF1F "]}},{"poll_type":"group_message","value":{"msg_id":35099,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886140,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":1552311252,"seq":919683,"time":1338859546,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u597D\u597D\u597D \u4F60\u662F\u7537\u751F \u6EE1\u610F\u4E86\u4E48 "]}},{"poll_type":"group_message","value":{"msg_id":35098,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886139,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":3721566410,"seq":919682,"time":1338859529,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u6709\u60C5\u51B5",["face",0]," "]}},{"poll_type":"group_message","value":{"msg_id":35097,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886138,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":3620961896,"seq":919681,"time":1338859521,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u74E6\u4ECE\u6765\u4E0D\u88C5 "]}},{"poll_type":"group_message","value":{"msg_id":35096,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886137,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":1552311252,"seq":919680,"time":1338859499,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u4F60\u8BF4\u4F60\u4E00\u76F4\u88C5\u7537\u7684\u6709\u610F\u601D\u74E6 \u5E7C\u7A1A "]}},{"poll_type":"group_message","value":{"msg_id":35095,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886136,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":3721566410,"seq":919679,"time":1338859488,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],["face",57]," "]}},{"poll_type":"group_message","value":{"msg_id":35094,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886135,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":3620961896,"seq":919678,"time":1338859484,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u53C8\u4E0D\u662F\u771F\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u6211\u5E74\u9F84\u8FD80\u5462 "]}},{"poll_type":"group_message","value":{"msg_id":35093,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886134,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":3620961896,"seq":919677,"time":1338859467,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u6728\u6709\uFF0C\u8D44\u6599\u4E0D\u4E00\u5B9A\u662F\u771F\u7684 "]}},{"poll_type":"group_message","value":{"msg_id":35092,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886133,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":3721566410,"seq":919676,"time":1338859388,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u597D\u5427\uFF0C\u4ED6\u8FD8\u662F\u4FDD\u6301\u5728\u52A8\u7269\u9636\u6BB5 "]}},{"poll_type":"group_message","value":{"msg_id":35091,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886132,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":1552311252,"seq":919675,"time":1338859384,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u6211\u770B\u4F60\u8D44\u6599\u7684",["face",85]," "]}},{"poll_type":"group_message","value":{"msg_id":35090,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886131,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":3620961896,"seq":919674,"time":1338859374,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u6211\u548C\u65AD\u6C34\u4E00\u4E2A\u6027\u522B\u3002\u3002\u3002 "]}},{"poll_type":"group_message","value":{"msg_id":35089,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886130,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":3620961896,"seq":919673,"time":1338859356,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],["face",75],"\u8C01\u8BF4\u6211\u662F\u6BCD\u7684\u4E86 "]}},{"poll_type":"group_message","value":{"msg_id":35088,"from_uin":1024710259,"to_uin":1019955269,"msg_id2":886129,"msg_type":43,"reply_ip":176882269,"group_code":345088435,"send_uin":3721566410,"seq":919672,"time":1338859352,"info_seq":102527432,"content":[["font",{"size":9,"color":"000000","style":[0,0,0],"name":"\u5B8B\u4F53"}],"\u8D28\u91CF\u6709\u4FDD\u8BC1 "]}}]} 注意看poll_type,他是消息类型,如:group_message表示群消息。其他还有QQ好友消息,系统消息等,不一一列举,多抓几次包就明白! 特别提醒: 1、此次获取,需要设置HTTP获取等待时间无限长,因为只有当收到QQ消息时,腾讯才会通过这个地址把消息推送给你,没有消息时,你要无限等待! 2、获取到消息之后,需要立即到这个地址继续无限等待,不然QQ不就会下线! 3、腾讯不是一条一条消息分好几次推送给你,有好几条消息时,他会一起推送,注意查收! |
本帖隐藏的内容地址: http://d.web2.qq.com/channel/send_buddy_msg2方式:POST 参数3个: r ={"to":2094337943,"face":0,"content":"[\" 334\",[\"font\",{\"name\":\"\\u5b8b\\u4f53\",\"size\":\"10\",\"style\":[0,0,0],\"color\":\"993366\"}]]","msg_id":23500002,"clientid":"11350546","psessionid":"8368046764001e636f6e6e7365727665725f77656271714031302e3132382e36362e31313500003c8a000019a8026e04004548cb3c6d0000000a406542387165794b4b4b6d0000002877c759bb8a633ff2f63f51cca8d7accadc13599f5852f1ec0952495dacac5fb51a4c01d937aeac41"} clientid=11350546 psessionid=8368046764001e636f6e6e7365727665725f77656271714031302e3132382e36362e31313500003c8a000019a8026e04004548cb3c6d0000000a406542387165794b4b4b6d0000002877c759bb8a633ff2f63f51cca8d7accadc13599f5852f1ec0952495dacac5fb51a4c01d937aeac41 发送成功返回: {"retcode":0,"result":"ok"} 红色部分为信息内容,如下图 [\"font\",{\"name\":\"\\u5b8b\\u4f53\",\"size\":\"10\",\"style\":[0,0,0],\"color\":\"993366\"}] font字体样式,name字体名称,style加粗、斜体、下划线样式、color字体颜色 注意事项: POST时我们一定要转码,首先URL转码,然后UTF8转码! 实际值为 r=%7B%22to%22%3A2094337943%2C%22face%22%3A0%2C%22content%22%3A%22%5B%5C%22334%5C%22%2C%5B%5C%22font%5C%22%2C%7B%5C%22name%5C%22%3A%5C%22%5C%5Cu5b8b%5C%5Cu4f53%5C%22%2C%5C%22size%5C%22%3A%5C%2210%5C%22%2C%5C%22style%5C%22%3A%5B0%2C0%2C0%5D%2C%5C%22color%5C%22%3A%5C%22993366%5C%22%7D%5D%5D%22%2C%22msg_id%22%3A23500002%2C%22clientid%22%3A%2211350546%22%2C%22psessionid%22%3A%228368046764001e636f6e6e7365727665725f77656271714031302e3132382e36362e31313500003c8a000019a8026e04004548cb3c6d0000000a406542387165794b4b4b6d0000002877c759bb8a633ff2f63f51cca8d7accadc13599f5852f1ec0952495dacac5fb51a4c01d937aeac41%22%7D&clientid=11350546&psessionid=8368046764001e636f6e6e7365727665725f77656271714031302e3132382e36362e31313500003c8a000019a8026e04004548cb3c6d0000000a406542387165794b4b4b6d0000002877c759bb8a633ff2f63f51cca8d7accadc13599f5852f1ec0952495dacac5fb51a4c01d937aeac41 消息发送不出去的常见原因: 1、发送之后直接返回错误页面,说明参数,转码,COOKIES不对! 2、返回0,一开始能发送出去,后来却又发送不去了,原因可能是程序采用单线程运作,这种现象经常会出现,在我们发送消息的时候,需要一个线程去获取消息,即POLL。简单来说,发送消息和接收消息需要两个独立的线程单独完成,不可将其合成一个线程里面。再有就是"msg_id":23500002,看看是否累加1,前面的数字是随机数,后面的数字需要累加,第1条消息就是1,第二条消息就是2。。。 |
本帖隐藏的内容地址: http://d.web2.qq.com/channel/send_qun_msg2方式:POST 参数: r = {"group_uin":2393471267,"content":"[\"33333\",[\"font\",{\"name\":\"\\u5b8b\\u4f53\",\"size\":\"10\",\"style\":[0,0,0],\"color\":\"993366\"}]]","msg_id":23500004,"clientid":"11350546","psessionid":"8368046764001e636f6e6e7365727665725f77656271714031302e3132382e36362e31313500003c8a000019a8026e04004548cb3c6d0000000a406542387165794b4b4b6d0000002877c759bb8a633ff2f63f51cca8d7accadc13599f5852f1ec0952495dacac5fb51a4c01d937aeac41"} clientid = 11350546 psessionid = 8368046764001e636f6e6e7365727665725f77656271714031302e3132382e36362e31313500003c8a000019a8026e04004548cb3c6d0000000a406542387165794b4b4b6d0000002877c759bb8a633ff2f63f51cca8d7accadc13599f5852f1ec0952495dacac5fb51a4c01d937aeac41 成功返回: {"retcode":0,"result":"ok"} 和发送QQ好友消息差不多,不多数! 注意:发送QQ群消息,包含网址的消息是发送不去的,虽然成功返回{"retcode":0,"result":"ok"},实际没发送,被TX屏蔽! |