From 9d04b23fb2a8ba9915f5b2416b6e3f10da0c90df Mon Sep 17 00:00:00 2001 From: stefancastille Date: Tue, 16 Jun 2015 17:23:25 +0200 Subject: [PATCH 1/8] Update browser.rb add support for virtual hosts --- lib/common/browser.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/common/browser.rb b/lib/common/browser.rb index 6cbe37f2..02e5545c 100644 --- a/lib/common/browser.rb +++ b/lib/common/browser.rb @@ -24,7 +24,7 @@ class Browser attr_reader :hydra, :cache_dir - attr_accessor :referer, :cookie + attr_accessor :referer, :cookie, :virtualHost # @param [ Hash ] options # @@ -135,7 +135,15 @@ class Browser @basic_auth ) end - + + if virtualHost + params = Browser.append_params_header_field( + params, + 'Host', + virtualHost + ) + end + params.merge!(referer: referer) params.merge!(timeout: @request_timeout) if @request_timeout params.merge!(connecttimeout: @connect_timeout) if @connect_timeout From 94bab3f55093a4c6a183e390b64c0877d62075e8 Mon Sep 17 00:00:00 2001 From: stefancastille Date: Wed, 17 Jun 2015 08:42:59 +0200 Subject: [PATCH 2/8] Update wpscan_options.rb Add support for virtual hosts --- lib/wpscan/wpscan_options.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/wpscan/wpscan_options.rb b/lib/wpscan/wpscan_options.rb index dbe03ebc..ad60f0b9 100644 --- a/lib/wpscan/wpscan_options.rb +++ b/lib/wpscan/wpscan_options.rb @@ -19,6 +19,7 @@ class WpscanOptions :proxy_auth, :threads, :url, + :virtualHost, :wordlist, :force, :update, From e16c5584d14bcd1e8a3dce79056c7f85277df5f6 Mon Sep 17 00:00:00 2001 From: stefancastille Date: Wed, 17 Jun 2015 08:44:04 +0200 Subject: [PATCH 3/8] Update wpscan_options.rb --- lib/wpscan/wpscan_options.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/wpscan/wpscan_options.rb b/lib/wpscan/wpscan_options.rb index ad60f0b9..e2162385 100644 --- a/lib/wpscan/wpscan_options.rb +++ b/lib/wpscan/wpscan_options.rb @@ -62,6 +62,10 @@ class WpscanOptions @url = URI.parse(add_http_protocol(url)).to_s end + def virtualHost=(virtualhost) + @virtualHost = virtualhost + end + def threads=(threads) @threads = threads.is_a?(Integer) ? threads : threads.to_i end From cc41b96e88b36a376efd3b61d099de1e1502d106 Mon Sep 17 00:00:00 2001 From: stefancastille Date: Wed, 17 Jun 2015 08:44:50 +0200 Subject: [PATCH 4/8] Update wpscan_options.rb --- lib/wpscan/wpscan_options.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/wpscan/wpscan_options.rb b/lib/wpscan/wpscan_options.rb index e2162385..3e333975 100644 --- a/lib/wpscan/wpscan_options.rb +++ b/lib/wpscan/wpscan_options.rb @@ -251,6 +251,7 @@ class WpscanOptions def self.get_opt_long GetoptLong.new( ['--url', '-u', GetoptLong::REQUIRED_ARGUMENT], + ['--virtualHost',GetoptLong::OPTIONAL_ARGUMENT], ['--enumerate', '-e', GetoptLong::OPTIONAL_ARGUMENT], ['--username', '-U', GetoptLong::REQUIRED_ARGUMENT], ['--usernames', GetoptLong::REQUIRED_ARGUMENT], From 86a73229c0e1b1d1242c5fec569a1721197880e2 Mon Sep 17 00:00:00 2001 From: stefancastille Date: Wed, 17 Jun 2015 08:46:14 +0200 Subject: [PATCH 5/8] Update wp_target.rb --- lib/wpscan/wp_target.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/wpscan/wp_target.rb b/lib/wpscan/wp_target.rb index 8fbb9bac..5b2727af 100644 --- a/lib/wpscan/wp_target.rb +++ b/lib/wpscan/wp_target.rb @@ -28,8 +28,13 @@ class WpTarget < WebSite @wp_content_dir = options[:wp_content_dir] @wp_plugins_dir = options[:wp_plugins_dir] @multisite = nil + @virtualHost = options[:virtualHost] Browser.instance.referer = url + if @virtualHost + Browser.instance.virtualHost = @virtualHost + end + end # check if the target website is From 15c0448cf11b63c87e98d9580c500f4050d48105 Mon Sep 17 00:00:00 2001 From: stefancastille Date: Thu, 25 Jun 2015 16:13:04 +0200 Subject: [PATCH 6/8] Update wpscan_options.rb --- lib/wpscan/wpscan_options.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/wpscan/wpscan_options.rb b/lib/wpscan/wpscan_options.rb index 3e333975..7a354df5 100644 --- a/lib/wpscan/wpscan_options.rb +++ b/lib/wpscan/wpscan_options.rb @@ -19,7 +19,7 @@ class WpscanOptions :proxy_auth, :threads, :url, - :virtualHost, + :vhost, :wordlist, :force, :update, @@ -62,8 +62,8 @@ class WpscanOptions @url = URI.parse(add_http_protocol(url)).to_s end - def virtualHost=(virtualhost) - @virtualHost = virtualhost + def vhost=(vhost) + @vhost = vhost end def threads=(threads) @@ -251,7 +251,7 @@ class WpscanOptions def self.get_opt_long GetoptLong.new( ['--url', '-u', GetoptLong::REQUIRED_ARGUMENT], - ['--virtualHost',GetoptLong::OPTIONAL_ARGUMENT], + ['--vhost',GetoptLong::OPTIONAL_ARGUMENT], ['--enumerate', '-e', GetoptLong::OPTIONAL_ARGUMENT], ['--username', '-U', GetoptLong::REQUIRED_ARGUMENT], ['--usernames', GetoptLong::REQUIRED_ARGUMENT], From 252f7622091ccd7236f947d678e60582fca868e9 Mon Sep 17 00:00:00 2001 From: stefancastille Date: Thu, 25 Jun 2015 16:17:03 +0200 Subject: [PATCH 7/8] Update wp_target.rb --- lib/wpscan/wp_target.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/wpscan/wp_target.rb b/lib/wpscan/wp_target.rb index 5b2727af..81d573bd 100644 --- a/lib/wpscan/wp_target.rb +++ b/lib/wpscan/wp_target.rb @@ -28,11 +28,11 @@ class WpTarget < WebSite @wp_content_dir = options[:wp_content_dir] @wp_plugins_dir = options[:wp_plugins_dir] @multisite = nil - @virtualHost = options[:virtualHost] + @vhost = options[:vhost] Browser.instance.referer = url - if @virtualHost - Browser.instance.virtualHost = @virtualHost + if @vhost + Browser.instance.vhost = @vhost end end From 6e56013a95997c80ea908d510abfd07205c36afc Mon Sep 17 00:00:00 2001 From: stefancastille Date: Thu, 25 Jun 2015 16:18:04 +0200 Subject: [PATCH 8/8] Update browser.rb --- lib/common/browser.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/common/browser.rb b/lib/common/browser.rb index 02e5545c..443b3c01 100644 --- a/lib/common/browser.rb +++ b/lib/common/browser.rb @@ -24,7 +24,7 @@ class Browser attr_reader :hydra, :cache_dir - attr_accessor :referer, :cookie, :virtualHost + attr_accessor :referer, :cookie, :vhost # @param [ Hash ] options # @@ -136,11 +136,11 @@ class Browser ) end - if virtualHost + if vhost params = Browser.append_params_header_field( params, 'Host', - virtualHost + vhost ) end