Sha256: 2c88aac777e87d6a655414afdafc89c821458fce81e6ed2afcec4626685d523b

Contents?: true

Size: 1.03 KB

Versions: 5

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

module WPScan
  module Finders
    module DynamicFinder
      module Version
        # Version finder using Xpath method
        class Xpath < WPScan::Finders::DynamicFinder::Version::Finder
          # @return [ Hash ]
          def self.child_class_constants
            @child_class_constants ||= super().merge(
              XPATH: nil, PATTERN: /\A(?<v>\d+\.[\.\d]+)/, CONFIDENCE: 60
            )
          end

          # @param [ Typhoeus::Response ] response
          # @param [ Hash ] opts
          # @return [ Version ]
          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
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wpscan-3.5.4 lib/wpscan/finders/dynamic_finder/version/xpath.rb
wpscan-3.5.3 lib/wpscan/finders/dynamic_finder/version/xpath.rb
wpscan-3.5.2 lib/wpscan/finders/dynamic_finder/version/xpath.rb
wpscan-3.5.1 lib/wpscan/finders/dynamic_finder/version/xpath.rb
wpscan-3.5.0 lib/wpscan/finders/dynamic_finder/version/xpath.rb