Class: WPScan::Finders::Themes::KnownLocations

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

Overview

Known Locations Themes Finder

Instance Method Summary collapse

Instance Method Details

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

Parameters:

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

Options Hash (opts):

  • :list (String)

Returns:

  • (Array<Theme>)


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

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

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

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

  found
end

#create_progress_bar(opts = {}) ⇒ Object



46
47
48
# File 'app/finders/themes/known_locations.rb', line 46

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)


35
36
37
38
39
40
41
42
43
44
# File 'app/finders/themes/known_locations.rb', line 35

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

#valid_response_codesArray<Integer>

Returns:

  • (Array<Integer>)


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

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