From a95c8a1fdfc44ea292205d1365af231f8b92019a Mon Sep 17 00:00:00 2001 From: Christian Mehlmauer Date: Mon, 28 Jan 2013 23:30:36 +0100 Subject: [PATCH] bugfix fot theme detection with relative URLs --- lib/wpscan/wp_theme.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/wpscan/wp_theme.rb b/lib/wpscan/wp_theme.rb index ab27c13e..1122a20d 100644 --- a/lib/wpscan/wp_theme.rb +++ b/lib/wpscan/wp_theme.rb @@ -64,7 +64,8 @@ class WpTheme < WpItem def self.find_from_css_link(target_uri) response = Browser.instance.get(target_uri.to_s, { follow_location: true, max_redirects: 2 }) - matches = %r{https?://[^"']+/([^/]+)/themes/([^"']+)/style.css}i.match(response.body) + # https + domain is optional because of relative links + matches = %r{(?:https?://[^"']+)?/([^/]+)/themes/([^"']+)/style.css}i.match(response.body) if matches style_url = matches[0] wp_content_dir = matches[1]