From 0adf62d408386c6664eddda089e7ddb74e12ee40 Mon Sep 17 00:00:00 2001 From: Christian Mehlmauer Date: Sun, 16 Sep 2012 10:02:36 +0200 Subject: [PATCH] don't output the filename url --- lib/wpscan/modules/wp_item.rb | 5 +++++ wpscan.rb | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/wpscan/modules/wp_item.rb b/lib/wpscan/modules/wp_item.rb index ae3e25b3..9febcc44 100644 --- a/lib/wpscan/modules/wp_item.rb +++ b/lib/wpscan/modules/wp_item.rb @@ -24,6 +24,11 @@ module WpItem URI.parse("#{@base_url.to_s}#@wp_content_dir/#@path") end + def get_url_without_filename + uri = get_url + URI.parse("#{uri.scheme}://#{uri.host}#{File.dirname(uri.path)}") + end + def version unless @version response = Browser.instance.get(get_url.merge("readme.txt").to_s) diff --git a/wpscan.rb b/wpscan.rb index 885dc52f..fb669e10 100755 --- a/wpscan.rb +++ b/wpscan.rb @@ -195,7 +195,7 @@ begin plugins.each do |plugin| puts puts " | Name: #{plugin}" #this will also output the version number if detected - puts " | Location: #{plugin.get_url}" + puts " | Location: #{plugin.get_url_without_filename}" puts " | Directory listing enabled? #{plugin.directory_listing? ? "Yes." : "No."}" plugin.vulnerabilities.each do |vulnerability| @@ -247,7 +247,7 @@ begin themes.each do |theme| puts puts " | Name: #{theme}" #this will also output the version number if detected - puts " | Location: #{theme.get_url}" + puts " | Location: #{theme.get_url_without_filename}" puts " | Directory listing enabled? #{theme.directory_listing? ? "Yes." : "No."}" theme.vulnerabilities.each do |vulnerability|