-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path012dnssubdom.py
47 lines (36 loc) · 1.1 KB
/
012dnssubdom.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
#!/usr/bin/python3
import requests
import sys
global host, wordlist
try:
host=input("\nPlease Enter The Server Domain/IP: ")
wordlist=input("\nPlease Enter Password Dictionary With Full Path: ")
if os.path.exists(wordlist) == False:
print("\nFile Doesnt Exists :(")
sys.exit()
else:
print("\nLoading The Password File :)")
except KeyboardInterrupt:
print("\nUser Stopped The Script :(")
sys.exit()
sub_list = open(wordlist).read()
subdoms = sub_list.splitlines()
for sub in subdoms:
sub_domains = f"http://{sub}.{sys.argv[1]}"
try:
requests.get(sub_domains)
except requests.ConnectionError:
pass
else:
print("Valid domain: ",sub_domains)
"""#!/usr/bin/env python3
import requests
host=input("\nPlease enter your target Domain name: ")
subs=open("/root/PycharmProjects/pythonProject/dictionary.txt", "r").read()
doms=subs.splitlines()
for xyz in doms:
try:
requests.get("http://"+xyz+"."+host)
print("http://"+xyz+"."+host)
except requests.ConnectionError:
pass