Skip to content

Commit 2582a12

Browse files
author
Michael Skelton
committed
Added used flags to file headers
1 parent 0142523 commit 2582a12

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

lib/helpers/output_helper.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
from lib.core.discovered_host import *
2+
from lib.helpers.file_helper import *
3+
import time
4+
5+
class output_helper(object):
6+
def __init__(self, scanner):
7+
self.scanner = scanner
8+
9+
def write_normal(self, filename):
10+
11+
file = file_helper(filename)
12+
13+
# todo: finish check_directory (needs regex to split out filename)
14+
# file.check_directory(filename)
15+
file.write_file(self.generate_header() + self.output_normal_likely() + self.output_normal_detail())
16+
17+
def output_normal_likely(self):
18+
output = "\n[+] Most likely matches with a unique count of {} or less:".format(str(self.scanner.unique_depth))
19+
for p in self.scanner.likely_matches(): output += "\n\t[>] {}".format(p)
20+
21+
return output
22+
23+
def output_normal_detail(self):
24+
output = "\n\n[+] Full scan results"
25+
26+
for p in self.scanner.hosts:
27+
output += "\n\n{} (Code: {}) hash: {}".format(str(p.hostname), str(p.response_code), str(p.hash))
28+
for key in p.keys: output += "\n\t{}".format(key)
29+
30+
return output
31+
32+
def generate_header(self):
33+
output = "VHostScanner Log: {} {}\n".format(time.strftime("%d/%m/%Y"), time.strftime("%H:%M:%S"))
34+
output += "\tTarget: {}\n\tBase Host: {}\n\tPort: {}".format(self.scanner.target, self.scanner.base_host, self.scanner.port)
35+
output += "\n\tReal Port {}\n\tIgnore HTTP Codes: {}".format(self.scanner.real_port,self.scanner.ignore_http_codes)
36+
output += "\n\tIgnore Content Length: {}\n\tWordlist: {}".format(self.scanner.ignore_content_length, self.scanner.wordlist)
37+
output += "\n\tUnique Depth: {}\n\tSSL: {}\n\t".format(self.scanner.unique_depth, self.scanner.ssl)
38+
return output

0 commit comments

Comments
 (0)