Added more CLI options

This commit is contained in:
FireFart
2014-03-01 14:09:05 +01:00
parent 25c2f3adad
commit b1b8066fe5
5 changed files with 39 additions and 6 deletions

8
README
View File

@@ -163,6 +163,14 @@ ryandewhurst at gmail
--username | -U <username> Only brute force the supplied username. --username | -U <username> Only brute force the supplied username.
--cache-ttl <cache-ttl> Typhoeus cache TTL
--request-timeout <request-timeout> Request Timeout
--connect-timeout <connect-timeout> Connect Timeout
--max-threads <max-threads> Maximum Threads
--help | -h This help screen. --help | -h This help screen.
--verbose | -v Verbose output. --verbose | -v Verbose output.

View File

@@ -177,6 +177,14 @@ Apple Xcode, Command Line Tools and the libffi are needed (to be able to install
--username | -U <username> Only brute force the supplied username. --username | -U <username> Only brute force the supplied username.
--cache-ttl <cache-ttl> Typhoeus cache TTL
--request-timeout <request-timeout> Request Timeout
--connect-timeout <connect-timeout> Connect Timeout
--max-threads <max-threads> Maximum Threads
--help | -h This help screen. --help | -h This help screen.
--verbose | -v Verbose output. --verbose | -v Verbose output.

View File

@@ -29,7 +29,9 @@ class Browser
def initialize(options = {}) def initialize(options = {})
@cache_dir = options[:cache_dir] || CACHE_DIR + '/browser' @cache_dir = options[:cache_dir] || CACHE_DIR + '/browser'
# sets browser defaults
browser_defaults browser_defaults
# overrides defaults with user supplied values
override_config(options) override_config(options)
unless @hydra unless @hydra
@@ -63,9 +65,12 @@ class Browser
# #
def browser_defaults def browser_defaults
@max_threads = 20 @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 # 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 @cache_ttl = 600
@connect_timeout = 1000 # 1s # 2s
@request_timeout = 2000
# 1s
@connect_timeout = 1000
@user_agent = "WPScan v#{WPSCAN_VERSION} (http://wpscan.org)" @user_agent = "WPScan v#{WPSCAN_VERSION} (http://wpscan.org)"
end end

View File

@@ -94,6 +94,10 @@ def help
puts '--wordlist | -w <wordlist> Supply a wordlist for the password bruter and do the brute.' puts '--wordlist | -w <wordlist> Supply a wordlist for the password bruter and do the brute.'
puts '--threads | -t <number of threads> The number of threads to use when multi-threading requests. (will override the value from conf/browser.conf.json)' puts '--threads | -t <number of threads> The number of threads to use when multi-threading requests. (will override the value from conf/browser.conf.json)'
puts '--username | -U <username> Only brute force the supplied username.' puts '--username | -U <username> Only brute force the supplied username.'
puts '--cache-ttl <cache-ttl> Typhoeus cache TTL'
puts '--request-timeout <request-timeout> Request Timeout'
puts '--connect-timeout <connect-timeout> Connect Timeout'
puts '--max-threads <max-threads> Maximum Threads'
puts '--help | -h This help screen.' puts '--help | -h This help screen.'
puts '--verbose | -v Verbose output.' puts '--verbose | -v Verbose output.'
puts puts

View File

@@ -32,7 +32,11 @@ class WpscanOptions
:debug_output, :debug_output,
:version, :version,
:user_agent, :user_agent,
:random_agent :random_agent,
:cache_ttl,
:request_timeout,
:connect_timeout,
:max_threads
] ]
attr_accessor *ACCESSOR_OPTIONS attr_accessor *ACCESSOR_OPTIONS
@@ -138,7 +142,7 @@ class WpscanOptions
!to_h.empty? !to_h.empty?
end end
def random_agent=(a) def random_agent=(useless)
@user_agent = get_random_user_agent @user_agent = get_random_user_agent
end end
@@ -246,7 +250,11 @@ class WpscanOptions
['--exclude-content-based', GetoptLong::REQUIRED_ARGUMENT], ['--exclude-content-based', GetoptLong::REQUIRED_ARGUMENT],
['--basic-auth', GetoptLong::REQUIRED_ARGUMENT], ['--basic-auth', GetoptLong::REQUIRED_ARGUMENT],
['--debug-output', GetoptLong::NO_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 end