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|