批量网站路径扫描
针对大量网站是否存在同一个路径的,扫描脚本
import requests
with open(r'读取网址文件的绝对路径','r',encoding = 'utf-8') as f:
a = f.readlines()
path = '网站的路径'
for i in a :
a = i.strip() + path + '\n'
try:
r = requests.get(a).status_code
if r == 200:
output = '路径存在'+ ':' + a
with open(r'最后输出存在路径的文件地址','a',encoding = 'utf-8') as f:
f.write(output)
else:
print('无法连接')
except:
print('响应超时')