-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsub3num.py
More file actions
70 lines (59 loc) · 1.9 KB
/
sub3num.py
File metadata and controls
70 lines (59 loc) · 1.9 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
# @AUTHOR: 4N4NRCH0
# Finding subdomains used by the target organization is an effective way to increase the attack surface and discover more vulnerabilities.
# The script will use a list of potential subdomains and prepends them to the domain name provided via a command-line argument.
# The script then tries to connect to the subdomains and assumes the ones that accept the connection exist.
import requests
import sys
import pyfiglet
from colorama import init, Fore, Back
def banner(titel):
init()
print(Fore.RED+"*"*73+Fore.RESET)
print(23*"-"+"\tCREATED BY 4N4RCH0\t"+"-"*23)
print(Back.BLACK+Fore.RED+pyfiglet.figlet_format(titel, font="poison")+Back.RESET+Fore.RESET)
print(Fore.RED+"*"*73+Fore.RESET)
target_subomains = [
"test",
"mail",
"ftp",
"www",
"skype",
"deklta1",
"demo",
"digital",
"disocver",
"elasticsearch",
"enterprise",
"erp",
"energy",
"os",
"proxy",
"payment",
"apps",
"myapps",
"marketing",
"sales",
"hr",
"finance",
"sip",
"error",
"20"
]
banner("Sub3num")
try:
for sub in target_subomains:
target_domain = f"http://{sub}.{sys.argv[1]}"
try:
print(Fore.WHITE+f"[...] Requesting {target_domain}"+Fore.RESET)
requests.get(target_domain)
except requests.ConnectionError:
print(Fore.RED+"[ - ] Domain unrechable: ",target_domain+Fore.RESET)
pass
else:
print(Fore.GREEN+"[ + ] Valid domain: ",target_domain+Fore.RESET)
except KeyboardInterrupt:
sys.exit()
except Exception as e:
print(f"[ERROR]\t{e}")
print("[USAGE]\tpython sub3num.py example.com")
sys.exit()