Repository navigation
Expand file tree
/
Copy pathmain.py
More file actions
79 lines (61 loc) · 2.49 KB
/
Copy pathmain.py
File metadata and controls
79 lines (61 loc) · 2.49 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import requests
print("""
╭━━━╮╱╱╭╮╱╱╱╭╮╱╱╱╱╱╱╱╱╱╱╱╱╱╭━━━╮
┃╭━╮┃╱╱┃┃╱╱╱┃┃╱╱╱╱╱╱╱╱╱╱╱╱╱┃╭━╮┃
┃╰━━┳╮╭┫╰━┳━╯┣━━┳╮╭┳━━┳┳━╮╱┃╰━━┳━━┳━━┳━╮╭━╮╭━━┳━╮
╰━━╮┃┃┃┃╭╮┃╭╮┃╭╮┃╰╯┃╭╮┣┫╭╮╮╰━━╮┃╭━┫╭╮┃╭╮┫╭╮┫┃━┫╭╯
┃╰━╯┃╰╯┃╰╯┃╰╯┃╰╯┃┃┃┃╭╮┃┃┃┃┃┃╰━╯┃╰━┫╭╮┃┃┃┃┃┃┃┃━┫┃
╰━━━┻━━┻━━┻━━┻━━┻┻┻┻╯╰┻┻╯╰╯╰━━━┻━━┻╯╰┻╯╰┻╯╰┻━━┻╯
</Developed By HeX_006>
""")
print()
domain = input("Enter The Website You Want To Scan: ")
http_or_https = input("Enter 1 For HTTP or Enter 2 For HTTPS: ")
print()
# opening the file
file = open('list.txt', 'r')
# reading the file
subdomain = file.read()
# add to a dic
subdomain = subdomain.splitlines()
subdomain_list = []
def http():
# runing a for loop to the subdomain dic
for subdomains in subdomain:
# making the Complete URL
url = f"http://{subdomains}.{domain}"
try:
# sending a request
requests.get(url)
# if ConnectionError pass
except requests.ConnectionError:
print("[-] Undiscovered Subdomain: " + url)
pass
else:
subdomain_list.append("[+] Discovered Subdomain: " + url + "\r\n")
print("[+] Discovered Subdomain: " + url)
def https():
# runing a for loop to the subdomain dic
for subdomains in subdomain:
# making the Complete URL
url = f"https://{subdomains}.{domain}"
try:
# sending a request
requests.get(url)
# if ConnectionError pass
except requests.ConnectionError:
print("[-] Undiscovered Subdomain: " + url)
pass
else:
subdomain_list.append("[+] Discovered Subdomain: " + url + "\r\n")
print("[+] Discovered Subdomain: " + url)
if http_or_https == "1":
http()
elif http_or_https == "2":
https()
for subdomain_lists in subdomain_list:
discoveredSubdomainFile = open("Discovered Subdomain.txt", 'a')
discoveredSubdomainFile.write(subdomain_lists)
discoveredSubdomainFile.close()
print()
print("[**] Scaning Finshed [**]")