-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdir3num.py
More file actions
45 lines (35 loc) · 1.38 KB
/
dir3num.py
File metadata and controls
45 lines (35 loc) · 1.38 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
# @AUTHOR: 4N4NRCH0
# As it is often pointed out, reconnaissance is one of the most critical steps to the success of a penetration testing engagement
# Once subdomains have been discovered, the next step would be to find directories
import requests
import sys
import pyfiglet
from colorama import init, Fore, Back
def banner(titel):
init()
print(Fore.RED+"*"*67+Fore.RESET)
print(17*"-"+"\tCREATED BY 4N4RCH0\t"+"-"*17)
print(Back.BLACK+Fore.RED+pyfiglet.figlet_format(titel, font="poison")+Back.RESET+Fore.RESET)
print(Fore.RED+"*"*67+Fore.RESET)
banner("dir3num")
dir_list = open("wordlist.txt").read()
directories = dir_list.splitlines()
enumerated_dirs = []
try:
for dir in directories:
dir_enum = f"http://{sys.argv[1]}/{dir}.html"
r = requests.get(dir_enum)
if r.status_code==404:
print(Fore.RED+f"[ - ] {dir_enum+Fore.RESET}\t\tdoes not exist or is not reachable."+Fore.RESET)
pass
else:
print(Fore.GREEN+f"[ + ] {dir_enum}\t\tValid directory found"+Fore.RESET)
enumerated_dirs.append(dir_enum)
print("\n[ ! ] Discovered web directories:\n")
for webdir in enumerated_dirs:
print(Fore.GREEN+f"[DISCOVERED]\t{webdir}"+Fore.RESET)
except KeyboardInterrupt:
sys.exit()
except Exception as e:
print(f"[ERROR]\t{e}")
sys.exit()