求大神写个python脚本 批量检测url中是否存在某个网页
例子批量检测http://192.168.0.0/检测这个url是否存在/phpmyadmin/index.php谢谢了...
例子批量检测
http://192.168.0.0/ 检测这个url是否存在/phpmyadmin/index.php
谢谢了 展开
http://192.168.0.0/ 检测这个url是否存在/phpmyadmin/index.php
谢谢了 展开
展开全部
#!/usr/bin/python
#coding=utf-8
import sys
import time
import requests
headers = {'User-Agent':"Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0"}##浏览器请求头
open_url = []
all_url = []
payloa = 'http://'
payload = '/phpmyadmin/index.php'
def search_url():
with open(r"C:\Users\ww\Desktop\ip_list.txt","r") as f :
for each in f:
each = each.replace('\n','')
urllist = payloa+each+payload
all_url.append(urllist)
handle_url(urllist)
def handle_url(urllist):
try:
start_htm = requests.get(urllist,headers=headers)
#print start_htm
if start_htm.status_code == 200:
print '**************************'
print urllist
except:
pass
if __name__ == "__main__":
search_url()
写了个简单的,有时间再加上多线程吧。希望能帮助到你。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询