php使用ICQ网关发送手机短信


Posted in PHP onOctober 30, 2013

通过ICQ网关发送手机短信的php源程序

<?
//###########################################################
//
// 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: http://web.icq.com/sms/send_session/1,,,00.html?prefix=+'.$prefix.'&carrier=&tophone='.$phonenumber.'
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!"; }
?>
PHP 相关文章推荐
PHP完整的日历类(CLASS)
Nov 27 PHP
php一句话cmdshell新型 (非一句话木马)
Apr 18 PHP
php 读取shell管道传输过来的内容
Mar 01 PHP
PHP下escape解码函数的实现方法
Aug 08 PHP
PHP学习笔记 用户注册模块用户类以及验证码类
Sep 20 PHP
浅析php单例模式
Nov 25 PHP
php读取远程gzip压缩网页的方法
Dec 29 PHP
php实现微信公众号无限群发
Oct 11 PHP
使用ThinkPHP的自动完成实现无限级分类实例详解
Sep 02 PHP
浅谈PHP中try{}catch{}的使用方法
Dec 09 PHP
Laravel5.* 打印出执行的sql语句的方法
Jul 24 PHP
php设计模式之正面模式实例分析【星际争霸游戏案例】
Mar 24 PHP
PHP分页详细讲解(有实例)
Oct 30 #PHP
php预定义变量使用帮助(带实例)
Oct 30 #PHP
调整PHP的性能
Oct 30 #PHP
PHP数据过滤的方法
Oct 30 #PHP
php另类上传图片的方法(PHP用Socket上传图片)
Oct 30 #PHP
使用Curl进行抓取远程内容时url中文编码问题示例探讨
Oct 29 #PHP
is_uploaded_file函数引发的不能上传文件问题
Oct 29 #PHP
You might like
基于PHP5魔术常量与魔术方法的详解
2013/06/13 PHP
PHP基于php_imagick_st-Q8.dll实现JPG合成GIF图片的方法
2014/07/11 PHP
PHP_SELF,SCRIPT_NAME,REQUEST_URI区别
2014/12/24 PHP
浅谈PHP中foreach/in_array的使用
2015/11/02 PHP
PHP面向对象自动加载机制原理与用法分析
2016/10/14 PHP
一个js的tab切换效果代码[代码分离]
2010/04/11 Javascript
jquery里的each使用方法详解
2010/12/22 Javascript
js在数组中删除重复的元素自保留一个(两种实现思路)
2014/08/22 Javascript
window.location 对象所包含的属性
2014/10/10 Javascript
nodejs微信公众号支付开发
2016/09/19 NodeJs
bootstrap实现每隔5秒自动轮播效果
2016/12/20 Javascript
JavaScript实现星星等级评价功能
2017/03/22 Javascript
Vuex和前端缓存的整合策略详解
2017/05/09 Javascript
JavaScript循环_动力节点Java学院整理
2017/06/28 Javascript
Angular通过angular-cli来搭建web前端项目的方法
2017/07/27 Javascript
详解vue组件基础
2018/05/04 Javascript
深入浅析js原型链和vue构造函数
2018/10/25 Javascript
JavaScript简单实现动态改变HTML内容的方法示例
2018/12/25 Javascript
使用webpack搭建vue环境的教程详解
2019/12/31 Javascript
js实现自定义右键菜单
2020/05/18 Javascript
python字符串替换示例
2014/04/24 Python
python dict.get()和dict['key']的区别详解
2016/06/30 Python
独特的python循环语句
2016/11/20 Python
Python中摘要算法MD5,SHA1简介及应用实例代码
2018/01/09 Python
在Pycharm terminal中字体大小设置的方法
2019/01/16 Python
Django项目使用CircleCI的方法示例
2019/07/14 Python
Python实现快速排序的方法详解
2019/10/25 Python
python将下载到本地m3u8视频合成MP4的代码详解
2020/11/24 Python
Python中过滤字符串列表的方法
2020/12/22 Python
ProBikeKit澳大利亚:自行车套件,跑步和铁人三项装备
2016/11/30 全球购物
特步官方商城:Xtep
2017/03/21 全球购物
自我鉴定思想方面
2013/10/07 职场文书
2015年六一儿童节演讲稿
2015/03/19 职场文书
运动会宣传稿50字
2015/07/23 职场文书
星际争霸:毕姥爷vs解冻01
2022/04/01 星际争霸
Windows server 2012 R2 安装IIS服务器
2022/04/29 Servers