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 += "\t Target: {}\n \t Base Host: {}\n \t Port: {}" .format (self .scanner .target , self .scanner .base_host , self .scanner .port )
35
+ output += "\n \t Real Port {}\n \t Ignore HTTP Codes: {}" .format (self .scanner .real_port ,self .scanner .ignore_http_codes )
36
+ output += "\n \t Ignore Content Length: {}\n \t Wordlist: {}" .format (self .scanner .ignore_content_length , self .scanner .wordlist )
37
+ output += "\n \t Unique Depth: {}\n \t SSL: {}\n \t " .format (self .scanner .unique_depth , self .scanner .ssl )
38
+ return output
0 commit comments