Class: WPScan::Finders::Plugins::BodyPattern

Inherits:
DynamicFinder::WpItems::Finder show all
Defined in:
app/finders/plugins/body_pattern.rb

Overview

Plugins finder from Dynamic Finder ‘BodyPattern’

Constant Summary collapse

DEFAULT_CONFIDENCE =
30

Instance Method Summary collapse

Methods inherited from DynamicFinder::WpItems::Finder

#aggressive, #aggressive_, #aggressive_configs, #aggressive_path, #passive, #passive_configs

Instance Method Details

#process_response(opts, response, slug, klass, config) ⇒ Plugin

Returns The detected plugin in the response, related to the config.

Parameters:

  • opts (Hash)

    The options from the #passive, #aggressive methods

  • response (Typhoeus::Response)
  • slug (String)
  • klass (String)
  • config (Hash)

    The related dynamic finder config hash

Returns:

  • (Plugin)

    The detected plugin in the response, related to the config



17
18
19
20
21
22
23
24
25
# File 'app/finders/plugins/body_pattern.rb', line 17

def process_response(opts, response, slug, klass, config)
  return unless response.body&.match?(config['pattern'])

  Model::Plugin.new(
    slug,
    target,
    opts.merge(found_by: found_by(klass), confidence: config['confidence'] || DEFAULT_CONFIDENCE)
  )
end