@@ -21,19 +21,23 @@ class virtual_host_scanner(object):
21
21
output: folder to write output file to
22
22
"""
23
23
24
- def __init__ (self , target , base_host , wordlist , port = 80 , real_port = 80 , ssl = False , unique_depth = 1 , ignore_http_codes = '404' , ignore_content_length = 0 , fuzzy_logic = False , rate_limit = 0 , add_waf_bypass_headers = False ):
24
+ def __init__ (self , target , wordlist , ** kwargs ):
25
25
self .target = target
26
- self .base_host = base_host
27
- self .port = int (port )
28
- self .real_port = int (real_port )
29
- self .ignore_http_codes = list (map (int , ignore_http_codes .replace (' ' , '' ).split (',' )))
30
- self .ignore_content_length = ignore_content_length
31
26
self .wordlist = wordlist
32
27
self .unique_depth = unique_depth
33
28
self .ssl = ssl
34
29
self .fuzzy_logic = fuzzy_logic
35
- self .rate_limit = rate_limit
30
+ self .rate_limit = rate_limit
36
31
self .add_waf_bypass_headers = add_waf_bypass_headers
32
+ self .base_host = kwargs .get ('base_host' )
33
+ self .port = int (kwargs .get ('port' , 80 ))
34
+ self .real_port = int (kwargs .get ('real_port' , 80 ))
35
+ self .ignore_content_length = int (kwargs .get ('ignore_content_length' , 0 ))
36
+ self .ssl = kwargs .get ('ssl' , False )
37
+ self .fuzzy_logic = kwargs .get ('fuzzy_logic' , False )
38
+ self .add_waf_bypass_headers = kwargs .get ('add_waf_bypass_headers' , False )
39
+ self .unique_depth = int (kwargs .get ('unique_depth' , 1 ))
40
+ self .ignore_http_codes = kwargs .get ('ignore_http_codes' , '404' )
37
41
38
42
# this can be made redundant in future with better exceptions
39
43
self .completed_scan = False
@@ -44,6 +48,13 @@ def __init__(self, target, base_host, wordlist, port=80, real_port=80, ssl=False
44
48
# store associated data for discovered hosts in array for oN, oJ, etc'
45
49
self .hosts = []
46
50
51
+ @property
52
+ def ignore_http_codes (self ):
53
+ return self ._ignore_http_codes
54
+
55
+ @ignore_http_codes .setter
56
+ def ignore_http_codes (self , codes ):
57
+ self ._ignore_http_codes = [int (code ) for code in codes .replace (' ' , '' ).split (',' )]
47
58
48
59
def scan (self ):
49
60
if not self .base_host :
0 commit comments