Class: WPScan::Finders::DynamicFinder::Version::BodyPattern

Inherits:
Finder show all
Defined in:
lib/wpscan/finders/dynamic_finder/version/body_pattern.rb

Overview

Version finder using Body Pattern method. Typically used when the response is not an HTML doc and Xpath can’t be used

Constant Summary

Constants inherited from Finder

Finder::DIRECT_ACCESS

Instance Attribute Summary

Attributes inherited from Finder

#progress_bar, #target

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Finder

#aggressive, child_class_constant, create_child_class, #passive

Methods inherited from Finder

#aggressive, #browser, #create_progress_bar, #found_by, #hydra, #initialize, #passive, #titleize

Constructor Details

This class inherits a constructor from WPScan::Finders::Finder

Class Method Details

.child_class_constantsHash

Returns:

  • (Hash)


11
12
13
# File 'lib/wpscan/finders/dynamic_finder/version/body_pattern.rb', line 11

def self.child_class_constants
  @child_class_constants ||= super.merge(PATTERN: nil, CONFIDENCE: 60)
end

Instance Method Details

#find(response, _opts = {}) ⇒ Version

Parameters:

Returns:



18
19
20
21
22
23
24
25
# File 'lib/wpscan/finders/dynamic_finder/version/body_pattern.rb', line 18

def find(response, _opts = {})
  return unless response.code != 404 && response.body =~ self.class::PATTERN

  create_version(
    Regexp.last_match[:v],
    interesting_entries: ["#{response.effective_url}, Match: '#{Regexp.last_match}'"]
  )
end