class WPScan::Finders::DynamicFinder::Version::HeaderPattern

Version finder using Header Pattern method

Public Class Methods

child_class_constants() click to toggle source

@return [ Hash ]

# File lib/wpscan/finders/dynamic_finder/version/header_pattern.rb, line 10
def self.child_class_constants
  @child_class_constants ||= super().merge(HEADER: nil, PATTERN: nil, CONFIDENCE: 60)
end

Public Instance Methods

find(response, _opts = {}) click to toggle source

@param [ Typhoeus::Response ] response @param [ Hash ] opts @return [ Version ]

# File lib/wpscan/finders/dynamic_finder/version/header_pattern.rb, line 17
def find(response, _opts = {})
  return unless response.headers && response.headers[self.class::HEADER]
  return unless response.headers[self.class::HEADER].to_s =~ self.class::PATTERN

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