class WPScan::Finders::DynamicFinder::Version::Xpath

Version finder using Xpath method

Public Class Methods

child_class_constants() click to toggle source

@return [ Hash ]

# File lib/wpscan/finders/dynamic_finder/version/xpath.rb, line 10
def self.child_class_constants
  @child_class_constants ||= super().merge(
    XPATH: nil, PATTERN: /\A(?<v>\d+\.[.\d]+)/, 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/xpath.rb, line 19
def find(response, _opts = {})
  target.xpath_pattern_from_page(
    self.class::XPATH, self.class::PATTERN, response
  ) do |match_data, _node|
    next unless match_data[:v]

    return create_version(
      match_data[:v],
      interesting_entries: ["#{response.effective_url}, Match: '#{match_data}'"]
    )
  end
  nil
end