From d382874e8630bffe336b1c4e37333686a5e23742 Mon Sep 17 00:00:00 2001 From: erwanlr Date: Mon, 12 Oct 2015 12:57:20 +0100 Subject: [PATCH] Fixes incorrect detection of the FDP data --- lib/wpscan/wp_target/wp_full_path_disclosure.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/wpscan/wp_target/wp_full_path_disclosure.rb b/lib/wpscan/wp_target/wp_full_path_disclosure.rb index 3fdf8dc9..a530e7c9 100644 --- a/lib/wpscan/wp_target/wp_full_path_disclosure.rb +++ b/lib/wpscan/wp_target/wp_full_path_disclosure.rb @@ -2,24 +2,21 @@ class WpTarget < WebSite module WpFullPathDisclosure - # Check for Full Path Disclosure (FPD) # # @return [ Boolean ] def has_full_path_disclosure? - response = Browser.get(full_path_disclosure_url) - response.body[%r{Fatal error}i] ? true : false + Browser.get(full_path_disclosure_url).body[%r/Fatal error/i] ? true : false end def full_path_disclosure_data return nil unless has_full_path_disclosure? - Browser.get(full_path_disclosure_url).body[%r{([^<]+\.php)}, 1] + Browser.get(full_path_disclosure_url).body[/Fatal error:.+? in (.+?) on/i, 1] end # @return [ String ] def full_path_disclosure_url @uri.merge('wp-includes/rss-functions.php').to_s end - end end