├── img ├── 1.jpg └── 2.jpg ├── README.md └── github-cve.py /img/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiang70/Github-Monitor/HEAD/img/1.jpg -------------------------------------------------------------------------------- /img/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiang70/Github-Monitor/HEAD/img/2.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Github-Monitor 2 | ## 对github新CVE,0DAY,RCE等的监控并推送到微信 3 | ----------------- 4 | 这个是在大神 洛米唯熊 脚本基础上改的,他用了itchat给微信推信息。 5 | 我改成了Server酱,简单一点,效果差不多。 6 | 注意:要把34行的KEY换成自己的Server酱KEY。如果你不知道Server酱是什么,请移步 7 | http://sc.ftqq.com 8 | 9 | ![image](img/2.jpg) 10 | 11 | 12 | ![image](/img/1.jpg) 13 | -------------------------------------------------------------------------------- /github-cve.py: -------------------------------------------------------------------------------- 1 | #coding = ctf-8 2 | 3 | import urllib 4 | import requests,re,time 5 | 6 | def getNews(): 7 | try: 8 | api = "https://api.github.com/search/repositories?q=CVE-2020&sort=updated" 9 | req = requests.get(api).text 10 | cve_total_count=re.findall ('"total_count":*.{1,10}"incomplete_results"',req)[0][14:17] 11 | cve_description=re.findall ('"description":*.{1,200}"fork"',req)[0].replace("\",\"fork\"",'').replace("\"description\":\"",'') 12 | cve_url=re.findall ('"svn_url":*.{1,200}"homepage"',req)[0].replace("\",\"homepage\"",'').replace("\"svn_url\":\"",'') 13 | 14 | return cve_total_count,cve_description,cve_url 15 | 16 | except Exception as e: 17 | print (e,"github链接不通") 18 | 19 | def sendNews(): 20 | try: 21 | while True: 22 | api = "https://api.github.com/search/repositories?q=CVE-2020&sort=updated" 23 | #请求API 24 | req = requests.get(api).text 25 | #正则获取 26 | total_count=re.findall ('"total_count":*.{1,10}"incomplete_results"',req)[0][14:17] 27 | #监控时间间隔3分钟 28 | time.sleep(180) 29 | #推送正文内容 30 | msg = str(getNews()) 31 | #推送标题 32 | text = r'有新的CVE送达!' 33 | #server酱请求url 34 | uri = 'https://sc.ftqq.com/KEY.send?text={}&desp={}'.format( 35 | text, msg) 36 | 37 | if total_count!=getNews()[0]: 38 | send = requests.get(uri) 39 | else: 40 | pass 41 | 42 | 43 | except Exception as e: 44 | raise e 45 | 46 | 47 | if __name__ == '__main__': 48 | sendNews() --------------------------------------------------------------------------------