笔记来源视频:
【小迪安全】web安全|渗透测试|网络安全(6个月线上培训全套)_哔哩哔哩_bilibili
信息收集-资产监控拓展
目录
·全自动域名收集枚举优秀脚本使用(github.com/bit4woo/teemo)
#Github 监控
注:便于获得某些网站的源码、脚本等等,网上会有相关小脚本(如果网站源码和某套程序有关,而网上又找不到对应源码,则可以利用脚本来监控“ctcms”等关键词,github上会有人把这个源码共享出来这时候就可以通过它们下载)或者大系统公司也有提供安装)
便于收集整理最新 exp 或 poc
exp:“漏洞利用”,意思是一段对漏洞如何利用的详细说明或者一个演示的漏洞攻击代码,可以使得读者完全了解漏洞的机理以及利用的方法。
poc:“观点证明”,漏洞报告中的POC则是一段说明或者一个攻击的样例,使得读者能够确认这个漏洞是真实存在的。
便于发现相关测试目标的资产
相关代码(python):
# Title: wechat push CVE-2020
# Date: 2020-5-9
# Exploit Author: weixiao9188
# Version: 4.0
# Tested on: Linux,windows
# cd /root/sh/git/ && nohup python3 /root/sh/git/git.py &
# coding:UTF-8
import requests
import json
import time
import os
import pandas as pd
time_sleep = 60 #每隔 20 秒爬取一次
while(True):
headers1 = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3741.400 QQBrowser/10.5.3863.400"}
#判断文件是否存在
datas = []
response1=None
response2=None
if os.path.exists("olddata.csv"):
#如果文件存在则每次爬取 10 个
df = pd.read_csv("olddata.csv", header=None)
datas = df.where(df.notnull(),None).values.tolist()#将提取出来的数据中的 nan 转化为 None
requests.packages.urllib3.disable_warnings()
response1 = requests.get(url="https://api.github.com/search/repositories?q=CVE2020&sort=updated&per_page=10",headers=headers1,verify=False)
response2 =
requests.get(url="https://api.github.com/search/repositories?q=RCE&ssort=updated&per_page=10",hea
ders=headers1,verify=False)
else:
#不存在爬取全部
datas = []
requests.packages.urllib3.disable_warnings()
response1 = requests.get(url="https://api.github.com/search/repositories?q=CVE2020&sort=updated&order=desc",headers=headers1,verify=False)
response2 =
requests.get(url="https://api.github.com/search/repositories?q=RCE&ssort=updated&order=desc",heade
rs=headers1,verify=False)
data1 = json.loads(response1.text)
data2 = json.loads(response2.text)
for j in [data1["items"],data2["items"]]:
for i in j:
s = {"name":i['name'],"html":i['html_url'],"description":i['description']}
s1 =[i['name'],i['html_url'],i['description']]
if s1 not in datas:
#print(s1)
先对于代码,要先安装相关的库文件(request和pandas)(pandas在python安装目录下的Scripts目录或者搜“pip.exe”文件),之后脚本才能正常运行。