Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rate limiting - Untested #40

Merged
merged 5 commits into from
Sep 30, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions VHostScan.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def main():
parser.add_argument('--unique-depth', dest='unique_depth', type=int, help='Show likely matches of page content that is found x times (default 1).', default=1)
parser.add_argument("--ssl", dest="ssl", action="store_true", help="If set then connections will be made over HTTPS instead of HTTP (default http).", default=False)
parser.add_argument("--fuzzy-logic", dest="fuzzy_logic", action="store_true", help="If set then fuzzy match will be performed against unique hosts (default off).", default=False)
parser.add_argument("--rate-limit", dest="rate_limit", type=int, help='Amount of time in seconds between each scan (default 0).', default=0)
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("-", dest="stdin", action="store_true", help="By passing a blank '-' you tell VHostScan to expect input from stdin (pipe).", default=False)
Expand Down
9 changes: 9 additions & 0 deletions lib/core/virtual_host_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import requests
import hashlib
import pandas as pd
import time
from lib.core.discovered_host import *


Expand All @@ -23,6 +24,11 @@ class virtual_host_scanner(object):
def __init__(self, target, wordlist, **kwargs):
self.target = target
self.wordlist = wordlist
self.unique_depth = unique_depth
self.ssl = ssl
self.fuzzy_logic = fuzzy_logic
self.rate_limit = rate_limit
self.add_waf_bypass_headers = add_waf_bypass_headers
self.base_host = kwargs.get('base_host')
self.port = int(kwargs.get('port', 80))
self.real_port = int(kwargs.get('real_port', 80))
Expand Down Expand Up @@ -111,6 +117,9 @@ 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)

self.completed_scan=True

Expand Down