diff --git a/UseHelp.md b/UseHelp.md index 1f7a5d1..f62038c 100644 --- a/UseHelp.md +++ b/UseHelp.md @@ -82,6 +82,28 @@ ps:因微信的原因,server酱的旧版将在2021年4月后下线,新版 `config.yaml`中配置`server`的`token`等信息,`enable`设置为 `1`表示推送 +## 推送加【Mac 版微信可用】 + +免费的微信模板消息通知,支持在 Mac 版微信查看 + +### Mac微信效果 + +![image-20220126110109185](images/image-20220126110109185.png) + +具体配置方法见 pushplus 公众号文章:https://mp.weixin.qq.com/s/YRYb04PUFNVZejzV2G-k4w + +同时也支持使用企业微信应用通知,只需从 API 接口修改默认配置即可: + +![image-20220126105710922](images/image-20220126105710922.png) + +修改成功: + +![image-20220126110312664](images/image-20220126110312664.png) + +### 企业微信应用效果 + +![image-20220126110919827](images/image-20220126110919827.png) + # Github 访问限制 监控工具更新 请求次数过多,超过了每小时请求,添加gihtub token diff --git a/github_cve_monitor.py b/github_cve_monitor.py index c8f77e4..1692e1e 100644 --- a/github_cve_monitor.py +++ b/github_cve_monitor.py @@ -5,7 +5,6 @@ # 每3分钟检测一次githu # 是否有新的cve漏洞提交记录,若有则通过server酱和钉钉机器人推送,飞书捷径推送(二者配置一个即可) # 建议使用screen命令运行在自己的linux vps后台上,就可以愉快的接收各种cve了 - # https://my.oschina.net/u/4581868/blog/4380482 # https://github.com/kiang70/Github-Monitor import json @@ -36,13 +35,17 @@ def load_config(): server_sckey = config['all_config']['server'][1]['sckey'] app_name = config['all_config']['server'][2]['app_name'] return app_name,github_token,server_sckey + elif int(config['all_config']['pushplus'][0]['enable']) == 1: + pushplus_token = config['all_config']['pushplus'][1]['token'] + app_name = config['all_config']['pushplus'][2]['app_name'] + return app_name,github_token,pushplus_token elif int(config['all_config']['tgbot'][0]['enable']) ==1 : tgbot_token = config['all_config']['tgbot'][1]['token'] tgbot_group_id = config['all_config']['tgbot'][2]['group_id'] app_name = config['all_config']['tgbot'][3]['app_name'] return app_name,github_token,tgbot_token,tgbot_group_id - elif int(config['all_config']['tgbot'][0]['enable']) == 0 and int(config['all_config']['feishu'][0]['enable']) == 0 and int(config['all_config']['server'][0]['enable']) == 0 and int(config['all_config']['dingding'][0]['enable']) == 0: - print("[-] 配置文件有误,四个社交软件的enable不能为0") + elif int(config['all_config']['tgbot'][0]['enable']) == 0 and int(config['all_config']['feishu'][0]['enable']) == 0 and int(config['all_config']['server'][0]['enable']) == 0 and int(config['all_config']['pushplus'][0]['enable']) == 0 and int(config['all_config']['dingding'][0]['enable']) == 0: + print("[-] 配置文件有误,五个社交软件的enable不能为0") github_headers = { 'Authorization': "token {}".format(load_config()[1]) @@ -80,6 +83,8 @@ def create_database(): dingding("test", "连接成功", load_config()[2], load_config()[3]) elif load_config()[0] == "server": server("test", "连接成功", load_config()[2]) + elif load_config()[0] == "pushplus": + pushplus("test", "连接成功", load_config()[2]) elif load_config()[0] == "tgbot": tgbot("test", "连接成功", load_config()[2], load_config()[3]) #根据排序获取本年前20条CVE @@ -259,6 +264,8 @@ def send_body(url,query_pushed_at,query_tag_name): dingding(text, body,load_config()[2],load_config()[3]) elif load_config()[0] == "server": server(text, body,load_config()[2]) + elif load_config()[0] == "pushplus": + pushplus(text, body,load_config()[2]) elif load_config()[0] == "tgbot": tgbot(text,body,load_config()[2],load_config()[3]) conn = sqlite3.connect('data.db') @@ -288,6 +295,8 @@ def send_body(url,query_pushed_at,query_tag_name): feishu(text,body,load_config()[2]) elif load_config()[0] == "server": server(text, body,load_config()[2]) + elif load_config()[0] == "pushplus": + pushplus(text, body,load_config()[2]) elif load_config()[0] == "tgbot": tgbot(text,body,load_config()[2],load_config()[3]) conn = sqlite3.connect('data.db') @@ -314,6 +323,8 @@ def send_body(url,query_pushed_at,query_tag_name): feishu(text,body,load_config[2]) elif load_config()[0] == "server": server(text, body, load_config()[2]) + elif load_config()[0] == "pushplus": + pushplus(text, body,load_config()[2]) elif load_config()[0] == "tgbot": tgbot(text, body, load_config()[2], load_config()[3]) conn = sqlite3.connect('data.db') @@ -393,6 +404,13 @@ def server(text, msg,sckey): requests.get(uri, headers=github_headers, timeout=10) except Exception as e: pass +# pushplus https://www.pushplus.plus/push1.html +def pushplus(text, msg,token): + try: + uri = 'https://www.pushplus.plus/send?token={}&title={}&content={}'.format(token,text, msg)# 将 xxxx 换成自己的pushplus的 token + requests.get(uri, headers=github_headers, timeout=10) + except Exception as e: + pass # 添加Telegram Bot推送支持 def tgbot(text, msg,token,group_id): import telegram @@ -443,6 +461,9 @@ def sendNews(data): elif load_config()[0] == "server": server(text, body, load_config()[2]) print("server酱 发送 CVE 成功") + elif load_config()[0] == "pushplus": + pushplus(text, body, load_config()[2]) + print("pushplus 发送 CVE 成功") elif load_config()[0] == "tgbot": tgbot(text, body, load_config()[2], load_config()[3]) print("tgbot 发送 CVE 成功") diff --git a/images/image-20220126105710922.png b/images/image-20220126105710922.png new file mode 100644 index 0000000..8bff513 Binary files /dev/null and b/images/image-20220126105710922.png differ diff --git a/images/image-20220126110109185.png b/images/image-20220126110109185.png new file mode 100644 index 0000000..0314cb5 Binary files /dev/null and b/images/image-20220126110109185.png differ diff --git a/images/image-20220126110312664.png b/images/image-20220126110312664.png new file mode 100644 index 0000000..e1c3a6c Binary files /dev/null and b/images/image-20220126110312664.png differ diff --git a/images/image-20220126110919827.png b/images/image-20220126110919827.png new file mode 100644 index 0000000..7ab7fd3 Binary files /dev/null and b/images/image-20220126110919827.png differ