Path: blob/master/app/finders/plugins/known_locations.rb
485 views
# frozen_string_literal: true12module WPScan3module Finders4module Plugins5# Known Locations Plugins Finder6class KnownLocations < CMSScanner::Finders::Finder7include CMSScanner::Finders::Finder::Enumerator89# @return [ Array<Integer> ]10def valid_response_codes11@valid_response_codes ||= [200, 401, 403, 500].freeze12end1314# @param [ Hash ] opts15# @option opts [ String ] :list16#17# @return [ Array<Plugin> ]18def aggressive(opts = {})19found = []2021enumerate(target_urls(opts), opts.merge(check_full_response: true)) do |res, slug|22finding_opts = opts.merge(found_by: found_by,23confidence: 80,24interesting_entries: ["#{res.effective_url}, status: #{res.code}"])2526found << Model::Plugin.new(slug, target, finding_opts)2728raise Error::PluginsThresholdReached if opts[:threshold].positive? && found.size >= opts[:threshold]29end3031found32end3334# @param [ Hash ] opts35# @option opts [ String ] :list36#37# @return [ Hash ]38def target_urls(opts = {})39slugs = opts[:list] || DB::Plugins.vulnerable_slugs40urls = {}4142slugs.each do |slug|43urls[target.plugin_url(slug)] = slug44end4546urls47end4849def create_progress_bar(opts = {})50super(opts.merge(title: ' Checking Known Locations -'))51end52end53end54end55end565758