7
7
from socket import gethostbyaddr
8
8
from lib .core .virtual_host_scanner import *
9
9
from lib .helpers .output_helper import *
10
- from lib .helpers .file_helper import get_combined_word_lists , load_random_user_agents
10
+ from lib .helpers .file_helper import get_combined_word_lists
11
+ from lib .helpers .file_helper import load_random_user_agents
11
12
from lib .core .__version__ import __version__
12
13
from lib .input import cli_argument_parser
13
14
15
+ DEFAULT_WORDLIST_FILE = os .path .join (
16
+ os .path .dirname (os .path .abspath (__file__ )),
17
+ 'wordlists' ,
18
+ 'virtual-host-scanning.txt'
19
+ )
20
+
14
21
15
22
def print_banner ():
16
23
print ("+-+-+-+-+-+-+-+-+-+ v. %s" % __version__ )
@@ -20,13 +27,14 @@ def print_banner():
20
27
21
28
def main ():
22
29
print_banner ()
23
-
30
+
24
31
parser = cli_argument_parser ()
25
32
arguments = parser .parse (sys .argv [1 :])
26
33
27
34
wordlist = []
28
35
word_list_types = []
29
- default_wordlist = "./wordlists/virtual-host-scanning.txt" if not arguments .stdin else None
36
+
37
+ default_wordlist = DEFAULT_WORDLIST_FILE if not arguments .stdin else None
30
38
31
39
if arguments .stdin :
32
40
word_list_types .append ('stdin' )
@@ -42,11 +50,14 @@ def main():
42
50
print ("[!] No words found in provided wordlists, unable to scan." )
43
51
sys .exit (1 )
44
52
45
- print ("[+] Starting virtual host scan for {host} using port {port} and {inputs}" .format (
46
- host = arguments .target_hosts ,
47
- port = arguments .port ,
48
- inputs = ', ' .join (word_list_types ),
49
- ))
53
+ print (
54
+ "[+] Starting virtual host scan for {host} using "
55
+ "port {port} and {inputs}" .format (
56
+ host = arguments .target_hosts ,
57
+ port = arguments .port ,
58
+ inputs = ', ' .join (word_list_types ),
59
+ )
60
+ )
50
61
51
62
user_agents = []
52
63
if arguments .user_agent :
@@ -62,10 +73,14 @@ def main():
62
73
if (arguments .add_waf_bypass_headers ):
63
74
print ("[>] WAF flag set, sending simple WAF bypass headers." )
64
75
65
- print ("[>] Ignoring HTTP codes: %s" % (arguments .ignore_http_codes ))
76
+ print ("[>] Ignoring HTTP codes: {}" . format (arguments .ignore_http_codes ))
66
77
67
78
if (arguments .ignore_content_length > 0 ):
68
- print ("[>] Ignoring Content length: %s" % (arguments .ignore_content_length ))
79
+ print (
80
+ "[>] Ignoring Content length: {}" .format (
81
+ arguments .ignore_content_length
82
+ )
83
+ )
69
84
70
85
if arguments .first_hit :
71
86
print ("[>] First hit is set." )
@@ -78,7 +93,12 @@ def main():
78
93
wordlist .extend (aliases )
79
94
80
95
scanner_args = vars (arguments )
81
- scanner_args .update ({'target' : arguments .target_hosts , 'wordlist' : wordlist , 'user_agents' : user_agents })
96
+ scanner_args .update ({
97
+ 'target' : arguments .target_hosts ,
98
+ 'wordlist' : wordlist ,
99
+ 'user_agents' : user_agents
100
+ })
101
+
82
102
scanner = virtual_host_scanner (** scanner_args )
83
103
scanner .scan ()
84
104
output = output_helper (scanner , arguments )
0 commit comments