python子域名爆破工具

""""
二、子域名爆破
通过暴力破解来获得子域名,类似子域名挖掘机的功能
"""
import requests
from  concurrent.futures import ThreadPoolExecutor
def pj(domain):
    with open('dic/text.txt','r') as f:
        key = f.readline().strip()

        while key:
            url = "http://"+key+"."+domain
            #url = "http://" + domain + "/" + key
            header = {
                "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36"
            }
            try:
                resp = requests.get(url,headers=header)
                if resp.status_code == 200:
                    print(url)
            except:
                pass
            key = f.readline().strip()
if __name__ == '__main__':
    domain = input("请输入域名:")
    pj(domain)

python子域名爆破工具_第1张图片

你可能感兴趣的:(python小脚本,python)