Sha256: 2de617c3affecbb413362d96b84942ecc6c7151bebd9751b15f3a029d4d22e80

Contents?: true

Size: 1.55 KB

Versions: 34

Compression:

Stored size: 1.55 KB

Contents

# frozen_string_literal: true

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

        # @return [ Array<Integer> ]
        def valid_response_codes
          @valid_response_codes ||= [200, 401, 403, 500].freeze
        end

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

          enumerate(target_urls(opts), opts.merge(check_full_response: true)) do |res, slug|
            finding_opts = opts.merge(found_by: found_by,
                                      confidence: 80,
                                      interesting_entries: ["#{res.effective_url}, status: #{res.code}"])

            found << Model::Theme.new(slug, target, finding_opts)

            raise Error::ThemesThresholdReached if opts[:threshold].positive? && found.size >= opts[:threshold]
          end

          found
        end

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

          slugs.each do |slug|
            urls[target.theme_url(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

34 entries across 34 versions & 1 rubygems

Version Path
wpscan-3.8.28 app/finders/themes/known_locations.rb
wpscan-3.8.27 app/finders/themes/known_locations.rb
wpscan-3.8.26 app/finders/themes/known_locations.rb
wpscan-3.8.25 app/finders/themes/known_locations.rb
wpscan-3.8.24 app/finders/themes/known_locations.rb
wpscan-3.8.22 app/finders/themes/known_locations.rb
wpscan-3.8.21 app/finders/themes/known_locations.rb
wpscan-3.8.20 app/finders/themes/known_locations.rb
wpscan-3.8.19 app/finders/themes/known_locations.rb
wpscan-3.8.18 app/finders/themes/known_locations.rb
wpscan-3.8.17 app/finders/themes/known_locations.rb
wpscan-3.8.16 app/finders/themes/known_locations.rb
wpscan-3.8.15 app/finders/themes/known_locations.rb
wpscan-3.8.14 app/finders/themes/known_locations.rb
wpscan-3.8.13 app/finders/themes/known_locations.rb
wpscan-3.8.12 app/finders/themes/known_locations.rb
wpscan-3.8.11 app/finders/themes/known_locations.rb
wpscan-3.8.10 app/finders/themes/known_locations.rb
wpscan-3.8.9 app/finders/themes/known_locations.rb
wpscan-3.8.8 app/finders/themes/known_locations.rb