set user agent globally
This commit is contained in:
@@ -71,13 +71,13 @@ class Browser
|
|||||||
# sets browser default values
|
# sets browser default values
|
||||||
#
|
#
|
||||||
def browser_defaults
|
def browser_defaults
|
||||||
|
@user_agent = "WPScan v#{WPSCAN_VERSION} (http://wpscan.org)"
|
||||||
@max_threads = 20
|
@max_threads = 20
|
||||||
# 10 minutes, at this time the cache is cleaned before each scan.
|
# 10 minutes, at this time the cache is cleaned before each scan.
|
||||||
# If this value is set to 0, the cache will be disabled
|
# If this value is set to 0, the cache will be disabled
|
||||||
@cache_ttl = 600
|
@cache_ttl = 600
|
||||||
@request_timeout = 60 # 60s
|
@request_timeout = 60 # 60s
|
||||||
@connect_timeout = 10 # 10s
|
@connect_timeout = 10 # 10s
|
||||||
@user_agent = "WPScan v#{WPSCAN_VERSION} (http://wpscan.org)"
|
|
||||||
@throttle = 0
|
@throttle = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -115,11 +115,7 @@ class Browser
|
|||||||
#
|
#
|
||||||
# @return [ Hash ]
|
# @return [ Hash ]
|
||||||
def merge_request_params(params = {})
|
def merge_request_params(params = {})
|
||||||
params = Browser.append_params_header_field(
|
Typhoeus::Config.user_agent = @user_agent
|
||||||
params,
|
|
||||||
'User-Agent',
|
|
||||||
@user_agent
|
|
||||||
)
|
|
||||||
|
|
||||||
if @proxy
|
if @proxy
|
||||||
params.merge!(proxy: @proxy)
|
params.merge!(proxy: @proxy)
|
||||||
|
|||||||
Reference in New Issue
Block a user