Sha256: 12ad61b7519047fdf19da1283b8262e7f68e107e180ad151ab1c3ceb1b1b3a80

Contents?: true

Size: 932 Bytes

Versions: 5

Compression:

Stored size: 932 Bytes

Contents

# frozen_string_literal: true

module WPScan
  module Finders
    module DynamicFinder
      module Version
        # Version finder using Body Pattern method. Tipically used when the response is not
        # an HTML doc and Xpath can't be used
        class BodyPattern < Finders::DynamicFinder::Version::Finder
          # @return [ Hash ]
          def self.child_class_constants
            @child_class_constants ||= super().merge(PATTERN: nil, CONFIDENCE: 60)
          end

          # @param [ Typhoeus::Response ] response
          # @param [ Hash ] opts
          # @return [ Version ]
          def find(response, _opts = {})
            return unless response.body =~ 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.6.3 lib/wpscan/finders/dynamic_finder/version/body_pattern.rb
wpscan-3.6.2 lib/wpscan/finders/dynamic_finder/version/body_pattern.rb
wpscan-3.6.1 lib/wpscan/finders/dynamic_finder/version/body_pattern.rb
wpscan-3.6.0 lib/wpscan/finders/dynamic_finder/version/body_pattern.rb
wpscan-3.5.5 lib/wpscan/finders/dynamic_finder/version/body_pattern.rb