国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > PHP > 正文

實現基本QQ功能的PHP類-QQ機器人

2020-03-24 17:29:57
字體:
來源:轉載
供稿:網友
1、研究說明Tencent在tqq.tencent.com的8000有一個使用HTTP的QQ接口,通過這個接口,可以進行一些基本的操作,如:登陸、登出、改變登陸狀態(上線、忙碌、離線、隱身)、添加刪除好友、查看好友信息、發送驗證信息(接受被加為好友、申請加對方為好友、拒絕被加為好友)、收發用戶消息、系統信息。目前我研究的是1.1版本的HTTP QQ協議,研究是微程在的成果上進行的,不敢說有什么超越,只不過更為詳細和準確。2、接口說明:接口位置:tqq.tencent.com:8000通信協議:HTTP數據傳輸方法:POSTHTTP請求格式:
POST HTTP/1.1

Host: tqq.tencent.com:8000

Content-Type: text/plain; charset=UTF-8

Content-length: 長度

Connection: close
以上4個參數是每個請求都必有的。其中,VER表示協議的版本,目前為1.1,據說1.2已經出來了,這個亂寫的話,服務器返回NULL;CMD為操作的指令,有Login、List、Query_Stat、GetInfo、AddToList、Ack_AddToList、DelFromList、Change_Stat、GetMsgEx、CLTMSG、Logout;SEQ為當前請求的標記,防止重復發送,可以用當前時間,也可以用隨機數;UIN是當前執行操作的QQ號。不過不同的CMD還需要不同的參數,下面我就公布我的研究成果。3、研究方法:我對目前網上的資料不夠滿意,就自己寫程序,發送多條相同CMD不同參數的請求,根據服務器的返回,來做判斷。感興趣的朋友可以參考一下,此處可以跳過。下面我公布我探測的代碼(PHP):

?

$uin = QQ號

$pwd = md5( QQ密碼

//登陸測試

$poststring[] = VER=1.1 CMD=Login SEQ= .rand(1000,9000). UIN= .$uin. PS= .$pwd. M5=1 LC=9326B87B234E7235

//注意:登陸測試不能同時進行,必須等到服務器認為QQ斷開了,才能夠測試,不然結果不可信

/*******

$poststring[] = VER=1.1 CMD=Login SEQ= .rand(1000,9000). UIN= .$uin. PS= .$pwd. M5=0 LC=9326B87B234E7235

$poststring[] = VER=1.1 CMD=Login SEQ= .rand(1000,9000). UIN= .$uin. PS= .$pwd. M5=1 LC=9326B87B234E7235

$poststring[] = VER=1.1 CMD=Login SEQ= .rand(1000,9000). UIN= .$uin. PS= .$pwd. M5=2 LC=9326B87B234E7235

$poststring[] = VER=1.1 CMD=Login SEQ= .rand(1000,9000). UIN= .$uin. PS= .$pwd. M5=3 LC=9326B87B234E7235

$poststring[] = VER=1.1 CMD=Login SEQ= .rand(1000,9000). UIN= .$uin. PS= .$pwd. M6=1 LC=9326B87B234E7235

$poststring[] = VER=1.1 CMD=Login SEQ= .rand(1000,9000). UIN= .$uin. PS= .$pwd. M6=1 LC=1223423545756679

*******/

//得到好友列表

$poststring[] = VER=1.1 CMD=List SEQ= .rand(1000,9000). UIN= .$uin;

$poststring[] = VER=1.1 CMD=List SEQ= .rand(1000,9000). UIN= .$uin. TN=0

$poststring[] = VER=1.1 CMD=List SEQ= .rand(1000,9000). UIN= .$uin. TN=160

$poststring[] = VER=1.1 CMD=List SEQ= .rand(1000,9000). UIN= .$uin. UN=0

$poststring[] = VER=1.1 CMD=List SEQ= .rand(1000,9000). UIN= .$uin. UN= .rand(1,10);

$poststring[] = VER=1.1 CMD=List SEQ= .rand(1000,9000). UIN= .$uin. TN=0 UN=0

$poststring[] = VER=1.1 CMD=List SEQ= .rand(1000,9000). UIN= .$uin. TN=160 UN=0

$poststring[] = VER=1.1 CMD=List SEQ= .rand(1000,9000). UIN= .$uin. TN=160 UN=0

$poststring[] = VER=1.1 CMD=List SEQ= .rand(1000,9000). UIN= .$uin. TN= .rand(1,200). UN=0

$poststring[] = VER=1.1 CMD=List SEQ= .rand(1000,9000). UIN= .$uin. TN= .rand(1,200). UN=0

$poststring[] = VER=1.1 CMD=List SEQ= .rand(1000,9000). UIN= .$uin. TN= .rand(1,200). UN=0

$poststring[] = VER=1.1 CMD=List SEQ= .rand(1000,9000). UIN= .$uin. TN=0 UN= .rand(1,10);

$poststring[] = VER=1.1 CMD=List SEQ= .rand(1000,9000). UIN= .$uin. TN=0 UN= .rand(1,10);

$poststring[] = VER=1.1 CMD=List SEQ= .rand(1000,9000). UIN= .$uin. TN=0 UN= .rand(1,10);

$poststring[] = VER=1.1 CMD=List SEQ= .rand(1000,9000). UIN= .$uin. TN=0 UN=106814

//得到在線列表

$poststring[] = VER=1.1 CMD=Query_Stat SEQ= .rand(1000,9000). UIN= .$uin;

$poststring[] = VER=1.1 CMD=Query_Stat SEQ= .rand(1000,9000). UIN= .$uin. TN=0

$poststring[] = VER=1.1 CMD=Query_Stat SEQ= .rand(1000,9000). UIN= .$uin. TN=160

$poststring[] = VER=1.1 CMD=Query_Stat SEQ= .rand(1000,9000). UIN= .$uin. UN=0

$poststring[] = VER=1.1 CMD=Query_Stat SEQ= .rand(1000,9000). UIN= .$uin. UN= .rand(1,10);

$poststring[] = VER=1.1 CMD=Query_Stat SEQ= .rand(1000,9000). UIN= .$uin. TN=0 UN=0

$poststring[] = VER=1.1 CMD=Query_Stat SEQ= .rand(1000,9000). UIN= .$uin. TN=160 UN=0

$poststring[] = VER=1.1 CMD=Query_Stat SEQ= .rand(1000,9000). UIN= .$uin. TN=160 UN=0

$poststring[] = VER=1.1 CMD=Query_Stat SEQ= .rand(1000,9000). UIN= .$uin. TN= .rand(1,200). UN=0

$poststring[] = VER=1.1 CMD=Query_Stat SEQ= .rand(1000,9000). UIN= .$uin. TN= .rand(1,200). UN=0

$poststring[] = VER=1.1 CMD=Query_Stat SEQ= .rand(1000,9000). UIN= .$uin. TN= .rand(1,200). UN=0

$poststring[] = VER=1.1 CMD=Query_Stat SEQ= .rand(1000,9000). UIN= .$uin. TN=0 UN= .rand(1,10);

$poststring[] = VER=1.1 CMD=Query_Stat SEQ= .rand(1000,9000). UIN= .$uin. TN=0 UN= .rand(1,10);

$poststring[] = VER=1.1 CMD=Query_Stat SEQ= .rand(1000,9000). UIN= .$uin. TN=0 UN= .rand(1,10);

$poststring[] = VER=1.1 CMD=Query_Stat SEQ= .rand(1000,9000). UIN= .$uin. TN=0 UN=106814

//查看好友信息

$poststring[] = VER=1.1 CMD=GetInfo SEQ= .rand(1000,9000). UIN= .$uin. LV=0 UN=106814

$poststring[] = VER=1.1 CMD=GetInfo SEQ= .rand(1000,9000). UIN= .$uin. LV=1 UN=106814

$poststring[] = VER=1.1 CMD=GetInfo SEQ= .rand(1000,9000). UIN= .$uin. LV=2 UN=106814

$poststring[] = VER=1.1 CMD=GetInfo SEQ= .rand(1000,9000). UIN= .$uin. LV=3 UN=106814

$poststring[] = VER=1.1 CMD=GetInfo SEQ= .rand(1000,9000). UIN= .$uin. LV=4 UN=106814

$poststring[] = VER=1.1 CMD=GetInfo SEQ= .rand(1000,9000). UIN= .$uin. LV=5 UN=106814

//增加好友

$poststring[] = VER=1.1 CMD=AddToList SEQ= .rand(1000,9000). UIN= .$uin. UN=106814

//發送驗證

$poststring[] = VER=1.1 CMD=Ack_AddToList SEQ= .rand(1000,9000). UIN= .$uin. UN=106814 CD=0 RS=TEST

$poststring[] = VER=1.1 CMD=Ack_AddToList SEQ= .rand(1000,9000). UIN= .$uin. UN=106814 CD=1 RS=TEST

$poststring[] = VER=1.1 CMD=Ack_AddToList SEQ= .rand(1000,9000). UIN= .$uin. UN=106814 CD=2 RS=TEST

$poststring[] = VER=1.1 CMD=Ack_AddToList SEQ= .rand(1000,9000). UIN= .$uin. UN=106814 CD=3 RS=TEST

$poststring[] = VER=1.1 CMD=Ack_AddToList SEQ= .rand(1000,9000). UIN= .$uin. UN=106814 CD=4 RS=TEST

$poststring[] = VER=1.1 CMD=Ack_AddToList SEQ= .rand(1000,9000). UIN= .$uin. UN=106814 CD=5 RS=TEST

//刪除好友

$poststring[] = VER=1.1 CMD=DelFromList SEQ= .rand(1000,9000). UIN= .$uin. UN=106814

//改變狀態

for($i=0;$i $i=$i+5)

{

$poststring[] = VER=1.1 CMD=Change_Stat SEQ= .rand(1000,9000). UIN= .$uin. ST= .$i;

}

//獲得消息

$poststring[] = VER=1.1 CMD=GetMsgEx SEQ= .rand(1000,9000). UIN= .$uin.

//發送消息

$poststring[] = VER=1.1 CMD=CLTMSG SEQ= .rand(1000,9000). UIN= .$uin. UN=106814 MG=TEST

//登出

$poststring[] = VER=1.1 CMD=Logout SEQ= .rand(1000,9000). UIN= .$uin.

$file = fopen( p.txt , w

foreach($poststring as $k= $v)

{

ss_timing_start();

$fp = fsockopen( tqq.tencent.com , 8000 , $errno, $errstr, $timeout = 10);

if(!$fp){

//error tell us

$content = $k.chr(13).chr(10). ERROR:$errstr ($errno)

}else{

//send the server request

fputs($fp, POST HTTP/1.1

// fputs($fp, Host: $host

// fputs($fp, Content-type: application/x-www-form-urlencoded

fputs($fp, Content-length: .strlen($v).

fputs($fp, Connection: close

fputs($fp, $v .

//loop through the response from the server

$res =

while(!feof($fp)) {

$res .= fgets($fp, 4096);

}

//close fp - we are done with it

fclose($fp);

$content = $v.chr(13).chr(10).$res;

}

ss_timing_stop();

$content .= chr(13).chr(10). Time: .ss_timing_html' target='_blank'>current().chr(13).chr(10). -------------------------------------- .chr(13).chr(10);

fputs($file,$content);

}

fclose($file);

?

function ss_timing_start ($name = default ) {

global $ss_timing_start_times;

$ss_timing_start_times[$name] = explode( , microtime());

}

function ss_timing_stop ($name = default ) {

global $ss_timing_stop_times;

$ss_timing_stop_times[$name] = explode( , microtime());

}

function ss_timing_current ($name = default ) {

global $ss_timing_start_times, $ss_timing_stop_times;

if (!isset($ss_timing_start_times[$name])) {

return 0;

}

if (!isset($ss_timing_stop_times[$name])) {

$stop_time = explode( , microtime());

}

else {

$stop_time = $ss_timing_stop_times[$name];

}

$current = $stop_time[1]-$ss_timing_start_times[$name][1];

$current += $stop_time[0]-$ss_timing_start_times[$name][0];

return $current;

}

?
html教程

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 鹿泉市| 安达市| 游戏| 盐山县| 昂仁县| 盈江县| 高雄市| 锡林郭勒盟| 大埔区| 大竹县| 上栗县| 苍溪县| 凤冈县| 葵青区| 舟曲县| 麻栗坡县| 株洲市| 伊春市| 新昌县| 朝阳县| 沐川县| 黄陵县| 遂平县| 安新县| 高邑县| 双城市| 玉山县| 晴隆县| 类乌齐县| 怀安县| 昆明市| 金堂县| 汝城县| 高青县| 邳州市| 府谷县| 潜山县| 霍城县| 邯郸市| 阳曲县| 呼伦贝尔市|