From 265bfcd7c871ef55072a6feb0aa917505fb21164 Mon Sep 17 00:00:00 2001 From: dctabuyz Date: Tue, 6 Jan 2015 19:11:57 +0300 Subject: [PATCH] calculate page hash only if response code is valid --- lib/wpscan/wp_target/wp_custom_directories.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wpscan/wp_target/wp_custom_directories.rb b/lib/wpscan/wp_target/wp_custom_directories.rb index 1e60791a..6a4d7354 100644 --- a/lib/wpscan/wp_target/wp_custom_directories.rb +++ b/lib/wpscan/wp_target/wp_custom_directories.rb @@ -23,9 +23,9 @@ class WpTarget < WebSite # @return [ Boolean ] def default_wp_content_dir_exists? response = Browser.get(@uri.merge('wp-content').to_s) - hash = Digest::MD5.hexdigest(response.body) if WpTarget.valid_response_codes.include?(response.code) + hash = Digest::MD5.hexdigest(response.body) return true if hash != error_404_hash and hash != homepage_hash end