diff --git a/lib/wpscan/modules/wp_plugins.rb b/lib/wpscan/modules/wp_plugins.rb index 809ed6ed..553da49f 100644 --- a/lib/wpscan/modules/wp_plugins.rb +++ b/lib/wpscan/modules/wp_plugins.rb @@ -24,7 +24,7 @@ module WpPlugins def plugins_from_aggressive_detection(options) options[:file] = options[:file] || (options[:full] ? "#{DATA_DIR}/plugins_full.txt" : "#{DATA_DIR}/plugins.txt") options[:vulns_file] = (options[:vulns_file] != nil and options[:vulns_file] != "") ? - options[:vulns_file] : DATA_DIR + "/plugin_vulns.xml" + options[:vulns_file] : DATA_DIR + "/plugin_vulns.xml" options[:vulns_xpath] = "//plugin[@name='#{@name}']/vulnerability" options[:vulns_xpath_2] = "//plugin" options[:type] = "plugins" diff --git a/lib/wpscan/wp_item.rb b/lib/wpscan/wp_item.rb index f0dc0689..69a1da4a 100644 --- a/lib/wpscan/wp_item.rb +++ b/lib/wpscan/wp_item.rb @@ -40,6 +40,12 @@ class WpItem < Vulnerable raise("type not set") unless @type end + # The wordpress.org plugins directory URL + # See: https://github.com/wpscanteam/wpscan/issues/100 + def wp_org_url + URI('http://wordpress.org/extend/plugins/').merge("#@name/") + end + def get_sub_folder case @type when "themes" diff --git a/lib/wpscan/wp_plugin.rb b/lib/wpscan/wp_plugin.rb index 7315771a..e6d7177b 100644 --- a/lib/wpscan/wp_plugin.rb +++ b/lib/wpscan/wp_plugin.rb @@ -19,7 +19,7 @@ class WpPlugin < WpItem def initialize(options = {}) options[:vulns_file] = (options[:vulns_file] != nil and options[:vulns_file] != "") ? - options[:vulns_file] : DATA_DIR + "/plugin_vulns.xml" + options[:vulns_file] : DATA_DIR + "/plugin_vulns.xml" options[:vulns_xpath] = "//plugin[@name='$name$']/vulnerability" options[:vulns_xpath_2] = "//plugin" options[:type] = "plugins" diff --git a/spec/lib/wpscan/wp_item_spec.rb b/spec/lib/wpscan/wp_item_spec.rb index 4d579daf..2ccb4627 100644 --- a/spec/lib/wpscan/wp_item_spec.rb +++ b/spec/lib/wpscan/wp_item_spec.rb @@ -436,4 +436,21 @@ describe WpPlugin do @instance.has_changelog?.should == false end end + + describe "#wp_org_url" do + before :each do + @instance = WpItem.new( + :base_url => "http://sub.example.com/path/to/wordpress/", + :path => "test/asdf.php", + :vulns_file => "XXX.xml", + :name => "test", + :vulns_xpath => "XX", + :type => "plugins" + ) + end + + it "should return the correct url" do + @expected = "http://wordpress.org/extend/plugins/test/" + end + end end diff --git a/wpscan.rb b/wpscan.rb index 1c7389d7..6fef3225 100755 --- a/wpscan.rb +++ b/wpscan.rb @@ -193,9 +193,11 @@ begin puts "#{plugins.size} found :" plugins.each do |plugin| + p plugin puts puts " | Name: #{plugin.name}" puts " | Location: #{plugin.get_full_url}" + puts " | WordPress: #{plugin.wp_org_url}" plugin.vulnerabilities.each do |vulnerability| puts " |"