是一個(gè)基于wxpy的工具,可以從你的網(wǎng)站、爬蟲、腳本等應(yīng)用程序向微信發(fā)送各種消息(日志、報(bào)警、運(yùn)行結(jié)果等)。
運(yùn)行環(huán)境
2.7 及以上 3 及以上
實(shí)施過程
安裝 pip 工具
[root@server1 ~]# wget https://bootstrap.pypa.io/get-pip.py [root@server1 ~]# python get-pip.py
pip 安裝模塊
##安裝依賴軟件 [root@server1 ~]# yum install -y gcc python-devel ##安裝 [root@server1 ~]# pip install wechat_sender
網(wǎng)頁(yè)登錄微信發(fā)消息
安裝網(wǎng)絡(luò)服務(wù)器
[root@server1 ~]# yum install -y httpd [root@server1 ~]# systemctl start http [root@server1 ~]# systemctl stop firewalld
[root@server1 ~]# cat /var/www/html/index.html <meta http-equiv="refresh" content="2"> <style> body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> <body>![]()
python腳本代碼
[root@server1 ~]# cat /var/www/html/sender.py #!/bin/bash/env python #coding:utf-8 from wxpy import * from wechat_sender import * from wechat_sender import Sender #bot = Bot() ##windows直接掃 #下面這個(gè)是服務(wù)器版(Linux) #bot = Bot(qr_path="qr.png") #避免重復(fù)登錄重復(fù)掃二維碼 bot = Bot(qr_path="qr.png",cache_path=True) ##通過文件助手給登錄的微信號(hào)發(fā)消息 bot.file_helper.send('Hello world!')網(wǎng)頁(yè)登錄微信
##執(zhí)行python腳本,占用終端,web登錄后會(huì)有提示 [root@server1 ~]# cd /var/www/html/ [root@server1 ~]# python sender.py Getting uuid of QR code. Downloading QR code. xdg-open: no method available for opening 'qr.png' Please scan the QR code to log in.另一方面,打開瀏覽器輸入ip或,微信掃一掃
微信登錄后釋放終端SpReader(純看圖軟件),提示成功,同時(shí)發(fā)送消息微防監(jiān)控軟件破解版,網(wǎng)頁(yè)二維碼無效
Login successfully as someone點(diǎn)擊微信確認(rèn)
查看手機(jī)助手時(shí)尚女性頭部剪影筆刷漂亮的放射光束筆刷,消息已收到!
監(jiān)控80端口微防監(jiān)控軟件破解版,自動(dòng)報(bào)警
如果web服務(wù)也在80端口,請(qǐng)登錄成功后進(jìn)行以下操作。
shell腳本
[root@server1 ~]# cat /var/www/html/check_80.sh #!/bin/sh x=$(netstat -antlp | grep '\<80\>'|awk -F' ' '{print $4}'|awk -F: '{print $2}') if [ "$x" != 80 ];then python /var/www/html/check_80.py & elsepython /var/www/html/check01_80.py & fi ##添加執(zhí)行權(quán)限 [root@server1 ~]# chomd +x /var/www/html/check_80.sh
[root@server1 ~]# cat /var/www/html/check01_80.py #!/bin/sh/env python #coding:utf-8 from wxpy import * from wechat_sender import * from wechat_sender import Sender bot = Bot(qr_path="qr.png",cache_path=True) ##通過文件助手給登錄的微信號(hào)發(fā)消息 bot.file_helper.send('port 80 nice!')[root@server1 ~]# cat /var/www/html/check_80.py #!/bin/sh/env python #coding:utf-8 from wxpy import * from wechat_sender import * from wechat_sender import Sender bot = Bot(qr_path="qr.png",cache_path=True) ##通過文件助手給登錄的微信號(hào)發(fā)消息 bot.file_helper.send('port 80 error!')[root@server1 ~]# cat /mnt/check.sh #!/bin/sh cd /var/www/html sh check_80.sh[root@server1 ~]# chmod +x /mnt/check.sh測(cè)試腳本
版權(quán)聲明:如無特殊標(biāo)注,文章均為本站原創(chuàng),轉(zhuǎn)載時(shí)請(qǐng)以鏈接形式注明文章出處。上一篇:教學(xué)考卷概論
下一篇:安卓版電腦試卷
發(fā)表評(píng)論