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