From b0f6902fa8e0b88e4d7c81e4d3e3baffbfe753da Mon Sep 17 00:00:00 2001 From: Christian Mehlmauer Date: Mon, 17 Sep 2012 17:56:02 +0200 Subject: [PATCH] bugfixing --- lib/wpscan/wp_detector.rb | 2 +- lib/wpscan/wp_enumerator.rb | 11 ++++++----- wpscan.rb | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/wpscan/wp_detector.rb b/lib/wpscan/wp_detector.rb index 27603a94..a477236a 100644 --- a/lib/wpscan/wp_detector.rb +++ b/lib/wpscan/wp_detector.rb @@ -61,7 +61,7 @@ class WpDetector names.each do |item| items << { - :url => url, + :url => url, :name => item, :path => "#{type}/#{item}/", :wp_content_dir => wp_content_dir diff --git a/lib/wpscan/wp_enumerator.rb b/lib/wpscan/wp_enumerator.rb index 7fda1ef3..92397b9a 100644 --- a/lib/wpscan/wp_enumerator.rb +++ b/lib/wpscan/wp_enumerator.rb @@ -50,11 +50,12 @@ class WpEnumerator enumerate_size = targets.size targets.each do |target| - if options[:type] =~ /timthumbs/i - url = "#{target[:url]}#{target[:wp_content_dir]}/#{target[:path]}" - else - url = "#{target[:url]}#{target[:wp_content_dir]}/#{options[:type]}/#{target[:path]}" + # Timthumb files have no /timthumbs/ directory + unless options[:type] =~ /timthumbs/i + target[:path] = "#{options[:type]}/#{target[:path]}" end + url = "#{target[:url]}#{target[:wp_content_dir]}/#{target[:path]}" + request = enum_browser.forge_request(url, :cache_timeout => 0, :follow_location => true) request_count += 1 @@ -120,7 +121,7 @@ class WpEnumerator if targets_url.grep(%r{/#{item_name}/}).empty? targets_url << { :url => url, - :path => "#{type}/#{item_name}", + :path => item_name, :wp_content_dir => wp_content_dir, :name => item_name } diff --git a/wpscan.rb b/wpscan.rb index 03afda5a..2a51208e 100755 --- a/wpscan.rb +++ b/wpscan.rb @@ -90,8 +90,8 @@ begin wp_theme = wp_target.theme if wp_theme - theme_version = wp_theme.version - puts "[!] The WordPress theme in use is #{wp_theme}#{' v' + theme_version if theme_version}" + # Theme version is handled in wp_item.to_s + puts "[!] The WordPress theme in use is #{wp_theme}" theme_vulnerabilities = wp_theme.vulnerabilities unless theme_vulnerabilities.empty?