Sha256: 6e2aa0c6a6bb8390e55979de2d9cae24fe1baf0bae1aa2801e7a83e92e60d155

Contents?: true

Size: 981 Bytes

Versions: 5

Compression:

Stored size: 981 Bytes

Contents

# frozen_string_literal: true

module WPScan
  module Finders
    module DynamicFinder
      module Version
        # Version finder using Header Pattern method
        class HeaderPattern < WPScan::Finders::DynamicFinder::Version::Finder
          # @return [ Hash ]
          def self.child_class_constants
            @child_class_constants ||= super().merge(HEADER: nil, PATTERN: nil, CONFIDENCE: 60)
          end

          # @param [ Typhoeus::Response ] response
          # @param [ Hash ] opts
          # @return [ Version ]
          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
        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/header_pattern.rb
wpscan-3.5.3 lib/wpscan/finders/dynamic_finder/version/header_pattern.rb
wpscan-3.5.2 lib/wpscan/finders/dynamic_finder/version/header_pattern.rb
wpscan-3.5.1 lib/wpscan/finders/dynamic_finder/version/header_pattern.rb
wpscan-3.5.0 lib/wpscan/finders/dynamic_finder/version/header_pattern.rb