-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathnull_dirb_vulns
executable file
·58 lines (47 loc) · 1.7 KB
/
null_dirb_vulns
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
#!/usr/bin/env python
#
__author__ = 'admanne'
import os
import os.path
import sys
import threading
if len(sys.argv) != 2:
print "Usage: dirbust.py <targets>"
sys.exit(0)
targets = str(sys.argv[1])
folders = ["/usr/share/dirb/wordlists/", "/usr/share/dirb/wordlists/vulns/"]
def dirb_thread(command_chain, blank):
os.system(command_chain)
out_put_files = []
f = [line.strip() for line in open(targets)]
for address in f:
command_chain = ""
print "INFO: Starting dirb scan for " + address
folder = '/usr/share/dirb/wordlists/vulns'
command_count = 0
for wordfile in os.listdir(folder):
wordlist = folder + wordfile
if wordlist[-3:] == "txt":
outfile = str(address) + str(".dirb")
url = "http://" + address
out_put_files.append(outfile)
command_chain += "xterm -e \"dirb %s %s -o %s -r \"; " % (url, wordlist, outfile)
command_count += 1
# print(command_count)
#print(command_chain)
t = threading.Thread(target=dirb_thread, args=(command_chain, ""))
t.start()
def dirb_analyze():
files = [f for f in os.listdir('.') if os.path.isfile(f)]
for f in files:
if f[-4:] == "dirb":
os.system('sort -u ' + f)
with open(f + '-results.txt', 'w') as outfile:
with open(f) as infile:
outfile.write('############# ' + f + ' #############\n')
for line in infile:
if "DIRECTORY" in line or "+" in line:
outfile.write(line)
outfile.write('#########################################\n')
os.system('sort -u ' + f + '-results.txt')
dirb_analyze()