diff --git a/README b/README index 2d4ff7ee..b7326402 100644 --- a/README +++ b/README @@ -163,6 +163,14 @@ ryandewhurst at gmail --username | -U Only brute force the supplied username. +--cache-ttl Typhoeus cache TTL + +--request-timeout Request Timeout + +--connect-timeout Connect Timeout + +--max-threads Maximum Threads + --help | -h This help screen. --verbose | -v Verbose output. diff --git a/README.md b/README.md index 7115707a..644d1c9b 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,14 @@ Apple Xcode, Command Line Tools and the libffi are needed (to be able to install --username | -U Only brute force the supplied username. + --cache-ttl Typhoeus cache TTL + + --request-timeout Request Timeout + + --connect-timeout Connect Timeout + + --max-threads Maximum Threads + --help | -h This help screen. --verbose | -v Verbose output. diff --git a/lib/common/browser.rb b/lib/common/browser.rb index 74c41fff..0a3ce7a9 100644 --- a/lib/common/browser.rb +++ b/lib/common/browser.rb @@ -29,7 +29,9 @@ class Browser def initialize(options = {}) @cache_dir = options[:cache_dir] || CACHE_DIR + '/browser' + # sets browser defaults browser_defaults + # overrides defaults with user supplied values override_config(options) unless @hydra @@ -63,9 +65,12 @@ class Browser # def browser_defaults @max_threads = 20 - @cache_ttl = 600 # 10 minutes, at this time the cache is cleaned before each scan. If this value is set to 0, the cache will be disabled - @request_timeout = 2000 # 2s - @connect_timeout = 1000 # 1s + # 10 minutes, at this time the cache is cleaned before each scan. If this value is set to 0, the cache will be disabled + @cache_ttl = 600 + # 2s + @request_timeout = 2000 + # 1s + @connect_timeout = 1000 @user_agent = "WPScan v#{WPSCAN_VERSION} (http://wpscan.org)" end diff --git a/lib/wpscan/wpscan_helper.rb b/lib/wpscan/wpscan_helper.rb index 44d409e4..39fee551 100644 --- a/lib/wpscan/wpscan_helper.rb +++ b/lib/wpscan/wpscan_helper.rb @@ -94,6 +94,10 @@ def help puts '--wordlist | -w Supply a wordlist for the password bruter and do the brute.' puts '--threads | -t The number of threads to use when multi-threading requests. (will override the value from conf/browser.conf.json)' puts '--username | -U Only brute force the supplied username.' + puts '--cache-ttl Typhoeus cache TTL' + puts '--request-timeout Request Timeout' + puts '--connect-timeout Connect Timeout' + puts '--max-threads Maximum Threads' puts '--help | -h This help screen.' puts '--verbose | -v Verbose output.' puts diff --git a/lib/wpscan/wpscan_options.rb b/lib/wpscan/wpscan_options.rb index c88ffebb..950badb7 100644 --- a/lib/wpscan/wpscan_options.rb +++ b/lib/wpscan/wpscan_options.rb @@ -32,7 +32,11 @@ class WpscanOptions :debug_output, :version, :user_agent, - :random_agent + :random_agent, + :cache_ttl, + :request_timeout, + :connect_timeout, + :max_threads ] attr_accessor *ACCESSOR_OPTIONS @@ -138,7 +142,7 @@ class WpscanOptions !to_h.empty? end - def random_agent=(a) + def random_agent=(useless) @user_agent = get_random_user_agent end @@ -246,7 +250,11 @@ class WpscanOptions ['--exclude-content-based', GetoptLong::REQUIRED_ARGUMENT], ['--basic-auth', GetoptLong::REQUIRED_ARGUMENT], ['--debug-output', GetoptLong::NO_ARGUMENT], - ['--version', GetoptLong::NO_ARGUMENT] + ['--version', GetoptLong::NO_ARGUMENT], + ['--cache_ttl', GetoptLong::REQUIRED_ARGUMENT], + ['--request_timeout', GetoptLong::REQUIRED_ARGUMENT], + ['--connect_timeout', GetoptLong::REQUIRED_ARGUMENT], + ['--max_threads', GetoptLong::REQUIRED_ARGUMENT] ) end