Skip to content

Commit 1125fe5

Browse files
authored
Merge branch 'master' into master
2 parents 6d76f8a + 40ee85c commit 1125fe5

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

VHostScan.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ def main():
7878
if(arguments.ignore_content_length > 0):
7979
print("[>] Ignoring Content length: %s" % (arguments.ignore_content_length))
8080

81-
scanner = virtual_host_scanner( arguments.target_hosts, arguments.base_host, wordlist, arguments.port, arguments.real_port, arguments.ssl,
82-
arguments.unique_depth, arguments.ignore_http_codes, arguments.ignore_content_length, arguments.fuzzy_logic, arguments.rate_limit, arguments.add_waf_bypass_headers)
81+
scanner_args = vars(arguments)
82+
scanner_args.update({'target': arguments.target_hosts, 'wordlist': wordlist})
83+
scanner = virtual_host_scanner(**scanner_args)
8384

8485
scanner.scan()
8586
output = output_helper(scanner, arguments)

lib/core/virtual_host_scanner.py

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)