From eaffb139ef17e0c72013ff79f744502707ac19e7 Mon Sep 17 00:00:00 2001 From: erwanlr Date: Mon, 11 Mar 2013 16:53:05 +0100 Subject: [PATCH] Bug Fix : Wp 3.5 & 3.5.1 not detected from advanced fingerprinting. Trying to reduce the complexity of WpVersion::find_from_advanced_fingerprinting --- data/wp_versions.xml | 2 +- lib/wpscan/wp_version.rb | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/data/wp_versions.xml b/data/wp_versions.xml index 4443b525..dbcfda3c 100644 --- a/data/wp_versions.xml +++ b/data/wp_versions.xml @@ -28,7 +28,7 @@ - + 3.5.1 diff --git a/lib/wpscan/wp_version.rb b/lib/wpscan/wp_version.rb index 722d70ae..3c74a045 100644 --- a/lib/wpscan/wp_version.rb +++ b/lib/wpscan/wp_version.rb @@ -62,6 +62,12 @@ class WpVersion < Vulnerable response.body[pattern, 1] end + # + # DO NOT Change the order of the following methods + # unless you know what you are doing + # See WpVersion.find + # + # Attempts to find the wordpress version from, # the generator meta tag in the html source. # @@ -146,9 +152,13 @@ class WpVersion < Vulnerable end xml.xpath('//file').each do |node| - file_url = target_uri.merge(node.attribute('src').text).to_s - file_url = file_url.gsub(/\$wp-plugins\$/i, wp_plugins).gsub(/\$wp-content\$/i, wp_content) - md5sum = Digest::MD5.hexdigest(Browser.instance.get(file_url).body) + file_src = node.attribute('src').text + file_url = target_uri.merge(file_src).to_s. + gsub(/\$wp-plugins\$/i, wp_plugins). + gsub(/\$wp-content\$/i, wp_content) + + response = Browser.instance.get(file_url) + md5sum = Digest::MD5.hexdigest(response.body) node.search('hash').each do |hash| if hash.attribute('md5').text == md5sum