-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscan-sub.py
54 lines (44 loc) · 1.24 KB
/
scan-sub.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# import requests
# def find_subdomain(domain, timeout=3):
# wordlist = [
# "admin",
# "api",
# "blog",
# "chat",
# "image",
# "login",
# "mail"
# ]
# for subdomain in wordlist:
# url = f"http://{subdomain}.{domain}"
# try:
# response = requests.get(url)
# status = response.status_code
# print(f"{url} - {status}")
# except requests.exceptions.RequestException:
# pass
# url = f"https://{subdomain}.{domain}"
# try:
# response = requests.get(url)
# status = response.status_code
# print(f"{url} - {status}")
# except request.exceptions.RequestExceptions:
# pass
# domain = "google.com"
# timeout = 4
# find_subdomain(domain, timeout)
import requests
domain = input("Enter domain: ")
file = open('list.txt','r')
content = file.read()
subdomains = content.splitlines()
for subdomain in subdomains:
url1 = f"http://{subdomain}.{domain}"
url2 = f"https://{subdomain}.{domain}"
try:
requests.get(url1)
print(f"Discovered URL: {url1}")
requests.get(url2)
print(f"Discovered URL: {url2}")
except requests.ConnectionError:
pass