标签:none one bgp 扫描 amp yun else utf-8 html
#ip段 https://bgp.he.net/
import requests
import threading
def get_title(ip):
try:
res = requests.get("http://"+ip,timeout=3)
if res.status_code == 200:
html = res.content.decode("utf-8")
title = html.split("<title>")[1].split("</title>")[0].strip()
else:
pass
title = f"{ip} {title[0:20]}"
except:
title = None
if (title):
print(title)
for m in range(0,10):
for i in range(0,255):
ip = f"39.104.{m}.{i}"
t=threading.Thread(target=get_title,args=(ip,))
t.start()
标签:none one bgp 扫描 amp yun else utf-8 html
原文地址:https://www.cnblogs.com/lijiext/p/12793198.html