@@ -21,19 +21,23 @@ class virtual_host_scanner(object):
2121 output: folder to write output file to
2222 """
2323
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 ):
2525 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
3126 self .wordlist = wordlist
3227 self .unique_depth = unique_depth
3328 self .ssl = ssl
3429 self .fuzzy_logic = fuzzy_logic
35- self .rate_limit = rate_limit
30+ self .rate_limit = rate_limit
3631 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' )
3741
3842 # this can be made redundant in future with better exceptions
3943 self .completed_scan = False
@@ -44,6 +48,13 @@ def __init__(self, target, base_host, wordlist, port=80, real_port=80, ssl=False
4448 # store associated data for discovered hosts in array for oN, oJ, etc'
4549 self .hosts = []
4650
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 (',' )]
4758
4859 def scan (self ):
4960 if not self .base_host :
0 commit comments