Sha256: 33d25064e087a70c40860a7f378b34759746db649f6d0c3aeae35ceaaf82fdb0

Contents?: true

Size: 1.36 KB

Versions: 13

Compression:

Stored size: 1.36 KB

Contents

module WPScan
  module Finders
    module Plugins
      # Known Locations Plugins Finder
      class KnownLocations < CMSScanner::Finders::Finder
        include CMSScanner::Finders::Finder::Enumerator

        # @param [ Hash ] opts
        # @option opts [ String ] :list
        #
        # @return [ Array<Plugin> ]
        def aggressive(opts = {})
          found = []

          enumerate(target_urls(opts), opts) do |res, slug|
            # TODO: follow the location (from enumerate()) and remove the 301 here ?
            # As a result, it might remove false positive due to redirection to the homepage
            next unless [200, 401, 403, 301].include?(res.code)

            found << WPScan::Plugin.new(slug, target, opts.merge(found_by: found_by, confidence: 80))
          end

          found
        end

        # @param [ Hash ] opts
        # @option opts [ String ] :list
        #
        # @return [ Hash ]
        def target_urls(opts = {})
          slugs       = opts[:list] || DB::Plugins.vulnerable_slugs
          urls        = {}
          plugins_url = target.plugins_url

          slugs.each do |slug|
            urls["#{plugins_url}#{URI.encode(slug)}/"] = slug
          end

          urls
        end

        def create_progress_bar(opts = {})
          super(opts.merge(title: ' Checking Known Locations -'))
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
wpscan-3.4.5 app/finders/plugins/known_locations.rb
wpscan-3.4.4 app/finders/plugins/known_locations.rb
wpscan-3.4.3 app/finders/plugins/known_locations.rb
wpscan-3.4.2 app/finders/plugins/known_locations.rb
wpscan-3.4.1 app/finders/plugins/known_locations.rb
wpscan-3.4.0 app/finders/plugins/known_locations.rb
wpscan-3.3.3 app/finders/plugins/known_locations.rb
wpscan-3.3.2 app/finders/plugins/known_locations.rb
wpscan-3.3.1 app/finders/plugins/known_locations.rb
wpscan-3.3.0 app/finders/plugins/known_locations.rb
wpscan-3.2.1 app/finders/plugins/known_locations.rb
wpscan-3.2.0 app/finders/plugins/known_locations.rb
wpscan-3.1.0 app/finders/plugins/known_locations.rb