So I made this subdomain finder from a hacking course. It seems to work fine for a little bit but then gives a weird error. Could anyone help me?
Here is the code
import requests
url = "youtube.com"
def request(url):
try:
return requests.get("http://" + url, timeout=2)
except requests.exceptions.ConnectionError:
pass
except requests.exceptions.InvalidURL:
print('INVALID:', url)
with open("/home/kali/PycharmProjects/websitesub/subdomains-wodlist.txt", "r") as wordlist_file:
for line in wordlist_file:
word = line.strip()
test_url = word + "." + url
response = request(test_url)
if response:
print("Discovered SUBDOM" + test_url)
here is the output I am getting, as we can see it finds a few websites then stops