初學Python練手專案,直接上程式碼,後續技術進步了可以加上指定字典掃描,現在還不會^_^
加上併發的話掃描速度會更快,現在也不會~
1 import requests 2 3 with open('domains.txt','r') as file: 4 domains =[line.strip() for line in file] 5 for domain in domains: 6 try: 7 response = requests.get(f'http://{domain}/admin') 8 if response.status_code == 200: 9 with open('res.txt','a') as file: 10 file.write(f'http://{domain}/admin\n') 11 except: 12 print(f'域名{domain}無法訪問') 13
執行結果