Merge pull request #833 from stefancastille/master
Adds a --vhost option (Virtualhost support)
This commit is contained in:
@@ -24,7 +24,7 @@ class Browser
|
|||||||
|
|
||||||
attr_reader :hydra, :cache_dir
|
attr_reader :hydra, :cache_dir
|
||||||
|
|
||||||
attr_accessor :referer, :cookie
|
attr_accessor :referer, :cookie, :vhost
|
||||||
|
|
||||||
# @param [ Hash ] options
|
# @param [ Hash ] options
|
||||||
#
|
#
|
||||||
@@ -136,6 +136,14 @@ class Browser
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if vhost
|
||||||
|
params = Browser.append_params_header_field(
|
||||||
|
params,
|
||||||
|
'Host',
|
||||||
|
vhost
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
params.merge!(referer: referer)
|
params.merge!(referer: referer)
|
||||||
params.merge!(timeout: @request_timeout) if @request_timeout
|
params.merge!(timeout: @request_timeout) if @request_timeout
|
||||||
params.merge!(connecttimeout: @connect_timeout) if @connect_timeout
|
params.merge!(connecttimeout: @connect_timeout) if @connect_timeout
|
||||||
|
|||||||
@@ -28,8 +28,13 @@ class WpTarget < WebSite
|
|||||||
@wp_content_dir = options[:wp_content_dir]
|
@wp_content_dir = options[:wp_content_dir]
|
||||||
@wp_plugins_dir = options[:wp_plugins_dir]
|
@wp_plugins_dir = options[:wp_plugins_dir]
|
||||||
@multisite = nil
|
@multisite = nil
|
||||||
|
@vhost = options[:vhost]
|
||||||
|
|
||||||
Browser.instance.referer = url
|
Browser.instance.referer = url
|
||||||
|
if @vhost
|
||||||
|
Browser.instance.vhost = @vhost
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# check if the target website is
|
# check if the target website is
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class WpscanOptions
|
|||||||
:proxy_auth,
|
:proxy_auth,
|
||||||
:threads,
|
:threads,
|
||||||
:url,
|
:url,
|
||||||
|
:vhost,
|
||||||
:wordlist,
|
:wordlist,
|
||||||
:force,
|
:force,
|
||||||
:update,
|
:update,
|
||||||
@@ -61,6 +62,10 @@ class WpscanOptions
|
|||||||
@url = URI.parse(add_http_protocol(url)).to_s
|
@url = URI.parse(add_http_protocol(url)).to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def vhost=(vhost)
|
||||||
|
@vhost = vhost
|
||||||
|
end
|
||||||
|
|
||||||
def threads=(threads)
|
def threads=(threads)
|
||||||
@threads = threads.is_a?(Integer) ? threads : threads.to_i
|
@threads = threads.is_a?(Integer) ? threads : threads.to_i
|
||||||
end
|
end
|
||||||
@@ -246,6 +251,7 @@ class WpscanOptions
|
|||||||
def self.get_opt_long
|
def self.get_opt_long
|
||||||
GetoptLong.new(
|
GetoptLong.new(
|
||||||
['--url', '-u', GetoptLong::REQUIRED_ARGUMENT],
|
['--url', '-u', GetoptLong::REQUIRED_ARGUMENT],
|
||||||
|
['--vhost',GetoptLong::OPTIONAL_ARGUMENT],
|
||||||
['--enumerate', '-e', GetoptLong::OPTIONAL_ARGUMENT],
|
['--enumerate', '-e', GetoptLong::OPTIONAL_ARGUMENT],
|
||||||
['--username', '-U', GetoptLong::REQUIRED_ARGUMENT],
|
['--username', '-U', GetoptLong::REQUIRED_ARGUMENT],
|
||||||
['--usernames', GetoptLong::REQUIRED_ARGUMENT],
|
['--usernames', GetoptLong::REQUIRED_ARGUMENT],
|
||||||
|
|||||||
Reference in New Issue
Block a user