diff --git a/README.md b/README.md index 72cd378..29f4f5e 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ $ pip install -r requirements.txt | --user-agent | Specify a user agent to use for scans. | | --waf | If set then simple WAF bypass headers will be sent. | | -oN OUTPUT_NORMAL | Normal output printed to a file when the -oN option is specified with a filename argument. | +| -oJ OUTPUT_JSON | JSON output printed to a file when the -oJ option is specified with a filename argument. | | - | By passing a blank '-' you tell VHostScan to expect input from stdin (pipe). | ## Usage Examples diff --git a/VHostScan.py b/VHostScan.py index 8071756..a5ef50b 100644 --- a/VHostScan.py +++ b/VHostScan.py @@ -37,6 +37,7 @@ def main(): parser.add_argument('--user-agent', dest='user_agent', type=str, help='Specify a user-agent to use for scans') parser.add_argument("--waf", dest="add_waf_bypass_headers", action="store_true", help="If set then simple WAF bypass headers will be sent.", default=False) parser.add_argument("-oN", dest="output_normal", help="Normal output printed to a file when the -oN option is specified with a filename argument." ) + parser.add_argument("-oJ", dest="output_json", help="JSON output printed to a file when the -oJ option is specified with a filename argument." ) parser.add_argument("-", dest="stdin", action="store_true", help="By passing a blank '-' you tell VHostScan to expect input from stdin (pipe).", default=False) arguments = parser.parse_args() @@ -108,6 +109,10 @@ def main(): output.write_normal(arguments.output_normal) print("\n[+] Writing normal ouptut to %s" % arguments.output_normal) + if(arguments.output_json): + output.output_json(arguments.output_json) + print("\n[+] Writing json ouptut to %s" % arguments.output_json) + if __name__ == "__main__": main() diff --git a/lib/core/__version__.py b/lib/core/__version__.py index b481d40..d1d6262 100644 --- a/lib/core/__version__.py +++ b/lib/core/__version__.py @@ -2,5 +2,5 @@ # |V|H|o|s|t|S|c|a|n| Developed by @codingo_ & @__timk # +-+-+-+-+-+-+-+-+-+ https://github.com/codingo/VHostScan -__version__ = '1.4' +__version__ = '1.5.1' diff --git a/lib/core/virtual_host_scanner.py b/lib/core/virtual_host_scanner.py index 0396011..3fc9cc5 100644 --- a/lib/core/virtual_host_scanner.py +++ b/lib/core/virtual_host_scanner.py @@ -119,8 +119,8 @@ def scan(self): # add url and hash into array for likely matches self.results.append(hostname + ',' + page_hash) - #rate limit the connection, if the int is 0 it is ignored - time.sleep(self.rate_limit) + #rate limit the connection, if the int is 0 it is ignored + time.sleep(self.rate_limit) self.completed_scan=True diff --git a/lib/helpers/output_helper.py b/lib/helpers/output_helper.py index e0aeb44..6071318 100644 --- a/lib/helpers/output_helper.py +++ b/lib/helpers/output_helper.py @@ -4,6 +4,7 @@ from fuzzywuzzy import fuzz import itertools import numpy as np +import json class output_helper(object): @@ -43,6 +44,20 @@ def output_normal_likely(self): return "\n[!] No matches with a unique count of {} or less.".format(depth) + def output_json(self, filename): + file = file_helper(filename) + list = dict() + for host in self.scanner.hosts: + headers = {} + for header in host.keys: + headers[header.split(':')[0]] = header.split(':')[1].strip() + + list[host.hostname] = {'Code': host.response_code, + 'Hash': host.hash, + 'Headers': headers} + file.write_file(json.dumps(list)) + + def output_fuzzy(self): output = "\n\n[+] Match similarity using fuzzy logic:" request_hashes = {} diff --git a/requirements.txt b/requirements.txt index 70f6425..f76d010 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +dnspython==1.15.0 fuzzywuzzy==0.15.1 numpy==1.12.0 pandas==0.19.2