Class: WPScan::Finders::Plugins::KnownLocations

Inherits:
CMSScanner::Finders::Finder
  • Object
show all
Includes:
CMSScanner::Finders::Finder::Enumerator
Defined in:
app/finders/plugins/known_locations.rb

Overview

Known Locations Plugins Finder

Instance Method Summary collapse

Instance Method Details

#aggressive(opts = {}) ⇒ Array<Plugin>

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :list (String)

Returns:

  • (Array<Plugin>)


19
20
21
22
23
24
25
26
27
# File 'app/finders/plugins/known_locations.rb', line 19

def aggressive(opts = {})
  found = []

  enumerate(target_urls(opts), opts.merge(check_full_response: true)) do |_res, slug|
    found << Model::Plugin.new(slug, target, opts.merge(found_by: found_by, confidence: 80))
  end

  found
end

#create_progress_bar(opts = {}) ⇒ Object



44
45
46
# File 'app/finders/plugins/known_locations.rb', line 44

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

#target_urls(opts = {}) ⇒ Hash

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :list (String)

Returns:

  • (Hash)


33
34
35
36
37
38
39
40
41
42
# File 'app/finders/plugins/known_locations.rb', line 33

def target_urls(opts = {})
  slugs       = opts[:list] || DB::Plugins.vulnerable_slugs
  urls        = {}

  slugs.each do |slug|
    urls[target.plugin_url(slug)] = slug
  end

  urls
end

#valid_response_codesArray<Integer>

Returns:

  • (Array<Integer>)


11
12
13
# File 'app/finders/plugins/known_locations.rb', line 11

def valid_response_codes
  @valid_response_codes ||= [200, 401, 403, 500].freeze
end