PHP下虚拟提交的例子(通过ICQ发短信)

PHP程序设计语言和相关项目讨论
Post Reply
User avatar
IOsetting
论坛管理员
论坛管理员
Posts: 3645
Joined: 2006-10-17 1:48

PHP下虚拟提交的例子(通过ICQ发短信)

Post by IOsetting » 2007-07-26 19:18

<?
//###########################################################
//
// For questions and comments
// Roland (alias -=: Vlieg :=-)
// icq #78354631
// mail: vlieg@atoomnet.net
//
// NB: This script won't work on free hosting pages, because of the secure mode!
// NB: You must have registered your ICQ# at http://web.icq.com/sms/login/ in order for this script to work
//###########################################################


//****************************************************************\//Config:

$uin=""; //your ICQ number
$passw=""; //your ICQpassword

$prefix=""; //sms prefix
$phonenumber=""; //sms phone number
$message = "Hello!"; //sms message


//****************************************************************\// EN: calculate the content length

$contentlength= ( 37+
strlen($uin)+
strlen($passw)
);

//****************************************************************\// Openen van de inlogpagina
// EN: open loginpage

$htmlreply="";
$post ="POST http://web.icq.com/karma/dologin/1,,,00.html HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*
Referer: http://web.icq.com/sms/login/1,,,00.html
Accept-Language: nl
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
Host: web.icq.com
Content-Length: ".$contentlength."
Proxy-Connection: Keep-Alive
Pragma: no-cache
Cookie: uin=".$uin."; sms_country=".$prefix."; KarmaService1=Yes; uin=".$uin."; sms_country=".$prefix."; KarmaService1=Yes

uService=1&uLogin=".$uin."&uPassword=".$passw."&x=0&y=0";

$remote = fsockopen("web.icq.com", 80, &$errno, &$errstr, 30);

global $remote;
global $post;
fputs($remote, $post);

while (!feof($remote)) { $htmlreply.=fgets($remote,120); }
//UNCOMMENT FOR OUTPUT: echo "".htmlspecialchars($htmlreply)."";
fclose($remote);

//****************************************************************\//persoonlijke cookie uit de inlogpage halen
// EN: fetch personal cookie from login page

$splited = split("\n",$htmlreply);
$cookies = $splited[3];
$cookies = str_replace("Set-Cookie: KarmaLogin=","",$cookies);
$cookies = str_replace("; path=/","",$cookies);
$cookies = str_replace("\n","",$cookies);
//UNCOMMENT VOOR OUTPUT: echo $cookies;

if (strlen($prefix) == 2) { $contentprefix = ' '.$prefix; } else { $contentprefix = $prefix; }
$charcount = (160-strlen($message));
$contentlength= ( 1561+
strlen($message)+
strlen($charcount)+
strlen($phonenumber)+
strlen($prefix)
);

//****************************************************************\//Verzendpagina openen met de opgehaalde cookie
// EN: open send page with fetched cookie

$htmlreply="";
$post ='POST http://web.icq.com/sms/send_history/1,,,00.html HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*
Referer: Accept-Language:' target=_blank>http://web.icq.com/sms/send_session/1,, ... honenumber.'
Accept-Language: nl
Content-Type: multipart/form-data; boundary=---------------------------7d12442eab4
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
Host: web.icq.com
Content-Length: '.$contentlength.'
Proxy-Connection: Keep-Alive
Pragma: no-cache
Cookie: uin='.$uin.'; sms_country='.$prefix.'; KarmaService1=Yes; KarmaLogin='.$cookies.'; uin='.$uin.'; sms_country='.$prefix.'; KarmaService1=Yes; KarmaLogin='.$cookies.'

-----------------------------7d12442eab4
Content-Disposition: form-data; name="carrier"


-----------------------------7d12442eab4
Content-Disposition: form-data; name="prefix"

'.$contentprefix.'
-----------------------------7d12442eab4
Content-Disposition: form-data; name="tophone"

'.$phonenumber.'
-----------------------------7d12442eab4
Content-Disposition: form-data; name="uSession"

1
-----------------------------7d12442eab4
Content-Disposition: form-data; name="uReply"


-----------------------------7d12442eab4
Content-Disposition: form-data; name="uLastId"


-----------------------------7d12442eab4
Content-Disposition: form-data; name="uSend"

1
-----------------------------7d12442eab4
Content-Disposition: form-data; name="uNextId"


-----------------------------7d12442eab4
Content-Disposition: form-data; name="uHistoryCounter"

1
-----------------------------7d12442eab4
Content-Disposition: form-data; name="count"

0
-----------------------------7d12442eab4
Content-Disposition: form-data; name="uSubmitCount"

0
-----------------------------7d12442eab4
Content-Disposition: form-data; name="checkNewMsg"

180000
-----------------------------7d12442eab4
Content-Disposition: form-data; name="charcount"

'.$charcount.'
-----------------------------7d12442eab4
Content-Disposition: form-data; name="msg"

'.$message.'
-----------------------------7d12442eab4
Content-Disposition: form-data; name="x"

30
-----------------------------7d12442eab4
Content-Disposition: form-data; name="y"

16
-----------------------------7d12442eab4--
';

$remote = fsockopen("web.icq.com", 80, &$errno, &$errstr, 30);

global $remote;
global $post;
fputs($remote, $post);

while (!feof($remote)) { $htmlreply.=fgets($remote,120); }
//UNCOMMENT FOR OUTPUT: echo "".htmlspecialchars($htmlreply)."";
fclose($remote);

//****************************************************************\// check if message is send if send 'moved permanently' is returned

if (eregi('Moved Permanently',$htmlreply))
{ echo "Sms message successfully sent!"; }
else
{ echo "Sms not sent!"; }
?>

User avatar
IOsetting
论坛管理员
论坛管理员
Posts: 3645
Joined: 2006-10-17 1:48

Re: PHP下虚拟提交的例子(通过ICQ发短信)

Post by IOsetting » 2007-07-26 19:20

另一个例子

function send($cmd,$path)
{
global $bbspath,$server,$cookie,$count,$useragent,$debug,$evilip;

$path=$bbspath."$path";
$message = "POST ".$path." HTTP/1.1\r\n";
$message .= "Accept: */*\r\n";
$message .= "Accept-Language: zh-cn\r\n";
$message .= "Referer: http://".$server.$path."\r\n";
$message .= "Content-Type: application/x-www-form-urlencoded\r\n";
$message .= "User-Agent: ".$useragent."\r\n";
$message .= "Host: ".$server."\r\n";
$message .= "Content-length: ".strlen($cmd)."\r\n";
$message .= "Connection: Keep-Alive\r\n";
$message .= "Cookie: ".$cookie."\r\n";
$message .= "\r\n";
$message .= $cmd."\r\n";

$count=$count+1;
$fd = fsockopen( $server, 80 );
fputs($fd,$message);
$resp = "<pre>";
while($fd&&!feof($fd)) {
$resp .= fread($fd,1024);
}
fclose($fd);
$resp .="</pre>";
if($debug) {echo $cmd;echo $resp;}
// echo $resp;
return $resp;
}

User avatar
fanisky
技术组成员
技术组成员
Posts: 510
Joined: 2007-04-15 15:03

Re: PHP下虚拟提交的例子(通过ICQ发短信)

Post by fanisky » 2007-07-27 9:18

;) 有qq的么。。。嘿嘿

User avatar
IOsetting
论坛管理员
论坛管理员
Posts: 3645
Joined: 2006-10-17 1:48

Re: PHP下虚拟提交的例子(通过ICQ发短信)

Post by IOsetting » 2007-07-30 15:56

没有... 理论上只要是可以通过网页来进行的动作php都可以完成

昨天借用上面的代码做了一个用php模拟用户 登录youtube, 获取cookie然后再点击confirm age的类, 用来得到youtube上成人视频的地址... :grin:

User avatar
fanisky
技术组成员
技术组成员
Posts: 510
Joined: 2007-04-15 15:03

Re: PHP下虚拟提交的例子(通过ICQ发短信)

Post by fanisky » 2007-07-30 18:19

成人视频?我也要我也要。。。

User avatar
IOsetting
论坛管理员
论坛管理员
Posts: 3645
Joined: 2006-10-17 1:48

Re: PHP下虚拟提交的例子(通过ICQ发短信)

Post by IOsetting » 2007-07-31 9:51

只要确认 >18岁都可以看, 可以自己注册一个帐号上去找, 其实就是一些类似钢管舞之类, 没有色情镜头的. :P

User avatar
fanisky
技术组成员
技术组成员
Posts: 510
Joined: 2007-04-15 15:03

Re: PHP下虚拟提交的例子(通过ICQ发短信)

Post by fanisky » 2007-07-31 17:23

没有的不要地说

User avatar
silasoni
新手入门
新手入门
Posts: 39
Joined: 2007-08-12 22:03

Re: PHP下虚拟提交的例子(通过ICQ发短信)

Post by silasoni » 2008-09-27 0:06

以前看过qq通过http接口登入 聊天的文章
不过那接口已经报废了吧

Post Reply