Skip to content

Commit 892c3b8

Browse files
committed
Closes #52 - Added command line flags for JSON output
1 parent 79b5a36 commit 892c3b8

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

lib/helpers/output_helper.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,28 @@ def output_normal_likely(self):
4646

4747
def output_json(self, filename):
4848
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()
5061
for host in self.scanner.hosts:
51-
headers = {}
62+
headers = dict()
5263
for header in host.keys:
5364
headers[header.split(':')[0]] = header.split(':')[1].strip()
5465

55-
list[host.hostname] = {'Code': host.response_code,
66+
result[host.hostname] = {'Code': host.response_code,
5667
'Hash': host.hash,
5768
'Headers': headers}
58-
file.write_file(json.dumps(list))
69+
output['Result'] = result
70+
file.write_file(json.dumps(output))
5971

6072

6173
def output_fuzzy(self):

0 commit comments

Comments
 (0)