forked from RedSiege/EyeWitness
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MiktoList.py
executable file
·45 lines (40 loc) · 1.45 KB
/
MiktoList.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
#!/usr/bin/env python
import glob
import os
import sys
import webbrowser
from distutils.util import strtobool
from modules.db_manager import DB_Manager
def open_file_input(cli_parsed):
files = glob.glob(os.path.join(cli_parsed.d, 'report.html'))
if len(files) > 0:
print 'Would you like to open the report now? [Y/n]',
while True:
try:
response = raw_input().lower()
if response is "":
return True
else:
return strtobool(response)
except ValueError:
print "Please respond with y or n",
else:
print '[*] No report files found to open, perhaps no hosts were successful'
return False
if __name__ == "__main__":
if len(sys.argv) < 2:
print 'Create a file containing urls for splash pages and 404s to feed to Mikto\n'
print '[*] Usage: python MiktoList.py <dbpath> <outfile>'
print 'DBPath should point to the ew.db file in your EyeWitness output folder'
sys.exit()
db_path = sys.argv[1]
outfile = sys.argv[2]
if not os.path.isfile(db_path):
print '[*] No valid db path provided'
sys.exit()
dbm = DB_Manager(db_path)
dbm.open_connection()
results = dbm.get_mikto_results()
with open(outfile, 'w') as f:
f.writelines([x.remote_system + '\n' for x in results])
print 'Wrote {0} URLs to {1}'.format(len(results), outfile)