好友
阅读权限10
听众
最后登录1970-1-1
|
本帖最后由 bloodfog 于 2017-10-11 21:09 编辑
1、开始运行执行
regsvr32 C:\WWSCommon.dll
;自动向指定人或群发送QQ消息 WWSCommon.dll 已经去除小尾巴
2、AutoIt3 代码
[Asm] 纯文本查看 复制代码
#AutoIt3Wrapper_Icon=D:\SHARE\door.ico ;
#AutoIt3Wrapper_UseX64=n
Run('"E:\Program Files\Tencent\QQLite\Bin\QQScLauncher.exe" /uin:10000 /quicklunch:6CA3C67753FC457FED4D88BAAE045377267EF8A4DD9ABCDE9591FD77003E61BAE571C044AF5103657')
Sleep(3000)
;WinActivate("QQ群名称","")
$obj=ObjCreate("WWSCommon.TCGroup")
$obj.TransMessage("QQ群名称","AUTOIT3 TEST")
Sleep(1000)
WinClose("QQ群名称") ;关闭窗口
3.拓展范例
[Asm] 纯文本查看 复制代码 #include <IE.au3>
#AutoIt3Wrapper_Icon=E:\AUTORUN\ico.ico ;
#AutoIt3Wrapper_UseX64=n
While 1 ;每60分钟执行一次
;获取主机IP
$sUrl = 'http://phpwebhome.com/ip.php'
$oHTTP = ObjCreate('microsoft.xmlhttp')
$oHTTP.Open('get', $sUrl, False)
$oHTTP.Send()
$sText = BinaryToString($oHTTP.responseBody, 4)
If StringRegExp($sText, '\d+\.\d+\.\d+\.\d+$',0) Then
;MsgBox(0,"IP",$sText)
Else
MsgBox(0,"网络错误报告","无法获取外网IP,请检测您的网络。")
$sUrla = 'http://192.168.10.30:2016/dmz.php'
$oHTTPa = ObjCreate('microsoft.xmlhttp')
$oHTTPa.Open('get', $sUrla, False)
$oHTTPa.Send()
$sTexta = BinaryToString($oHTTPa.responseBody, 4)
$errlog=@YEAR & "-" & @MON & "-" & @MDAY & " "& @HOUR & ":" & @MIN & ":" & @SEC & " 无法获取外网IP,请检测您的网络;<br>"
FileWrite('error.htm', $errlog)
;MsgBox(0,"DMZ",$sTexta)
Exit
EndIf
;获取汇率
$sUrlrate = 'http://phpwebhome.com/rate.php'
$oHTTPrate = ObjCreate('microsoft.xmlhttp')
$oHTTPrate.Open('get', $sUrlrate, False)
$oHTTPrate.Send()
$sTextrate = BinaryToString($oHTTPrate.responseBody, 4)
If $sTextrate<>'' Then
If FileExists(@YEAR&@MON&@MDAY&".htm") Then
Else
FileWrite(@YEAR&@MON&@MDAY&".htm", $sTextrate)
EndIf
EndIf
发送QQ消息
Run('"E:\Program Files\Tencent\QQLite\Bin\QQScLauncher.exe" /uin:QQ号 /quicklunch:D17B0262964CB5B91BDB261A185D5F2F739E0142DD979F1E3BA17B26DD23EDA177105761106F3AD3')
Sleep(5000)
;WinActivate("RAINMAN","")
$objrate=ObjCreate("WWSCommon.TCGroup")
$objrate.TransMessage("RAINMAN",$sTextrate)
Sleep(2000)
WinClose("RAINMAN")
;发送QQ消息
;获取汇率
$file = FileOpen("ip.ini", 0)
; 检查打开的文件是否可为读
If $file = -1 Then
;MsgBox(0, "错误", "未能找到文本ip.ini")
FileWrite('ip.ini', '')
EndIf
$chars = FileRead($file)
;MsgBox(0, "读取的字符:", $chars)
FileClose($file) ;关闭文本
If $chars <> $sText Then
;发送QQ消息
Run('"E:\Program Files\Tencent\QQLite\Bin\QQScLauncher.exe" /uin:QQ号 /quicklunch:D17B0262964CB5B91BDB261A185D5F2F739E0142DD979F1E3BA17B26DD23EDA177105761106F3AD3')
Sleep(3000)
;WinActivate("RAINMAN","")
$obj=ObjCreate("WWSCommon.TCGroup")
$note="您的主机IP已变更为 "&$sText
;MsgBox(0, "IP变更提醒", $note)
$obj.TransMessage("RAINMAN",$note)
Sleep(2000)
WinClose("RAINMAN")
;发送QQ消息
FileClose(FileOpen("ip.ini", 2)) ;清空文本内容
FileWrite('ip.ini', $sText)
EndIf
Sleep(3600000)
WEnd
4.设置路由器PHP代码 dmz.php
No Proxy-Authorization Header is present.
Authorization Header is present: Basic YWRtaW46cGFzc3dvcmQ=
Decoded Username:Password= admin:admin
[PHP] 纯文本查看 复制代码 <?php
$ch = curl_init();
$url = 'http://192.168.0.1/goform/RgDmzHost';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); //让cURL支持页面跳转
//https请求必须设置以下两项
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_HEADER,0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
//curl_setopt($ch, CURLOPT_COOKIESESSION,TRUE); //使用COOKIES开启
//设置凭证
$post = 'DmzHostIP3=253';
curl_setopt($ch,CURLOPT_POST,1);//使用post提交数据
curl_setopt($ch,CURLOPT_POSTFIELDS,$post);//设置 post提交的数据
curl_setopt($ch, CURLOPT_USERPWD, 'admin:pass'); //设置用户密码
//执行请求
$output = curl_exec($ch);
curl_close($ch);
function strbetweenAB($srcstr,$stra,$strb){
$i=strrpos($srcstr,$stra);
$j=strrpos($srcstr,$strb);
$b=substr($srcstr,$i+strlen($stra),$j-$i-strlen($stra));
return $b;
}
$stra="<b>192.168.0.</b><input name=DmzHostIP3 size=3 maxlength=3 value=";
$strb=">";
$str=strbetweenAB($output,$stra,$strb);
echo $str;
?> |
免费评分
-
查看全部评分
|