Sha256: ec82dd10fa3ca43bc188aeb754c57f9e46317168a1b2b24094e2459a670a7508

Contents?: true

Size: 1.04 KB

Versions: 13

Compression:

Stored size: 1.04 KB

Contents

module WPScan
  module Finders
    module Plugins
      # Plugins finder from the Dynamic Finder 'Comment'
      class Comment < WPScan::Finders::DynamicFinder::WpItems::Finder
        DEFAULT_CONFIDENCE = 30

        # @param [ Hash ] opts The options from the #passive, #aggressive methods
        # @param [ Typhoeus::Response ] response
        # @param [ String ] slug
        # @param [ String ] klass
        # @param [ Hash ] config The related dynamic finder config hash
        #
        # @return [ Plugin ] The detected plugin in the response, related to the config
        def process_response(opts, response, slug, klass, config)
          response.html.xpath(config['xpath'] || '//comment()').each do |node|
            comment = node.text.to_s.strip

            next unless comment =~ config['pattern']

            return Plugin.new(
              slug,
              target,
              opts.merge(found_by: found_by(klass), confidence: config['confidence'] || DEFAULT_CONFIDENCE)
            )
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
wpscan-3.4.5 app/finders/plugins/comment.rb
wpscan-3.4.4 app/finders/plugins/comment.rb
wpscan-3.4.3 app/finders/plugins/comment.rb
wpscan-3.4.2 app/finders/plugins/comment.rb
wpscan-3.4.1 app/finders/plugins/comment.rb
wpscan-3.4.0 app/finders/plugins/comment.rb
wpscan-3.3.3 app/finders/plugins/comment.rb
wpscan-3.3.2 app/finders/plugins/comment.rb
wpscan-3.3.1 app/finders/plugins/comment.rb
wpscan-3.3.0 app/finders/plugins/comment.rb
wpscan-3.2.1 app/finders/plugins/comment.rb
wpscan-3.2.0 app/finders/plugins/comment.rb
wpscan-3.1.0 app/finders/plugins/comment.rb