File tree 3 files changed +25
-9
lines changed
3 files changed +25
-9
lines changed Original file line number Diff line number Diff line change 2
2
# |V|H|o|s|t|S|c|a|n| Developed by @codingo_ & @__timk
3
3
# +-+-+-+-+-+-+-+-+-+ https://github.com/codingo/VHostScan
4
4
5
- __version__ = '1.5.1 '
5
+ __version__ = '1.5.2 '
6
6
Original file line number Diff line number Diff line change @@ -7,12 +7,13 @@ def __init__(self, output_file):
7
7
self .output_file = output_file
8
8
9
9
def check_directory (self ):
10
- directory = self .output_file
10
+ directory = os .path .dirname (self .output_file )
11
+
11
12
try :
12
- os .stat (self . directory )
13
+ os .stat (directory )
13
14
except :
14
- os .mkdir (self . directory )
15
- print ("[!] %s didn't exist and has been created." % output_directory )
15
+ os .mkdir (directory )
16
+ print ("[!] %s didn't exist and has been created." % directory )
16
17
17
18
# placeholder for error checking on -oJ implementation
18
19
def is_json (json_file ):
@@ -24,6 +25,9 @@ def is_json(json_file):
24
25
return True
25
26
26
27
def write_file (self , contents ):
28
+ # check if host directory exists, if not create it
29
+ self .check_directory ()
30
+
27
31
with open (self .output_file , "w" ) as o :
28
32
o .write (contents )
29
33
Original file line number Diff line number Diff line change @@ -46,16 +46,28 @@ def output_normal_likely(self):
46
46
47
47
def output_json (self , filename ):
48
48
file = file_helper (filename )
49
- list = dict ()
49
+ output = dict ()
50
+ output ['Start Time' ] = '{} {}' .format (time .strftime ("%d/%m/%Y" ), time .strftime ("%H:%M:%S" ))
51
+ output ['Target' ] = self .scanner .target
52
+ output ['Base Host' ] = self .scanner .base_host
53
+ output ['Port' ] = self .scanner .port
54
+ output ['Real Port' ] = self .scanner .real_port
55
+ output ['Ignore HTTP Codes' ] = self .scanner .ignore_http_codes
56
+ output ['Ignore Content Length' ] = self .scanner .ignore_content_length
57
+ output ['Wordlist' ] = self .scanner .wordlist
58
+ output ['Unique Depth' ] = self .scanner .unique_depth
59
+ output ['SSL' ] = self .scanner .ssl
60
+ result = dict ()
50
61
for host in self .scanner .hosts :
51
- headers = {}
62
+ headers = dict ()
52
63
for header in host .keys :
53
64
headers [header .split (':' )[0 ]] = header .split (':' )[1 ].strip ()
54
65
55
- list [host .hostname ] = {'Code' : host .response_code ,
66
+ result [host .hostname ] = {'Code' : host .response_code ,
56
67
'Hash' : host .hash ,
57
68
'Headers' : headers }
58
- file .write_file (json .dumps (list ))
69
+ output ['Result' ] = result
70
+ file .write_file (json .dumps (output ))
59
71
60
72
61
73
def output_fuzzy (self ):
You can’t perform that action at this time.
0 commit comments