killchain-compendium/enumeration/network_scanners/subdomain_enum.py

23 lines
395 B
Python
Executable File

#!/usr/bin/env python
import requests
import sys
subdomains = []
with open ("/home/whackx/Downloads/wordlist2.txt", 'r') as _f:
subdomains = _f.read().splitlines()
for sub in subdomains:
http_domain = f"http://{sub}.{sys.argv[1]}"
try:
requests.get(http_domain)
except requests.ConnectionError:
pass
else:
print("Valid domain: ", http_domain)