Sha256: ba11a91e8e67cf5f2f246733650a44afd6147b5c5a11700d4d91974cab3b969f

Contents?: true

Size: 899 Bytes

Versions: 9

Compression:

Stored size: 899 Bytes

Contents

module WPScan
  module Finders
    module Plugins
      # Plugins from Comments Finder
      class Comments < CMSScanner::Finders::Finder
        # @param [ Hash ] opts
        # @option opts [ Boolean ] :unique Default: true
        #
        # @return [ Array<Plugin> ]
        def passive(opts = {})
          found         = []
          opts[:unique] = true unless opts.key?(:unique)

          target.homepage_res.html.xpath('//comment()').each do |node|
            comment = node.text.to_s.strip

            DB::DynamicPluginFinders.comments.each do |name, config|
              next unless comment =~ config['pattern']

              plugin = WPScan::Plugin.new(name, target, opts.merge(found_by: found_by, confidence: 70))

              found << plugin unless opts[:unique] && found.include?(plugin)
            end
          end

          found
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wpscan-3.0.8 app/finders/plugins/comments.rb
wpscan-3.0.7 app/finders/plugins/comments.rb
wpscan-3.0.6 app/finders/plugins/comments.rb
wpscan-3.0.5 app/finders/plugins/comments.rb
wpscan-3.0.4 app/finders/plugins/comments.rb
wpscan-3.0.3 app/finders/plugins/comments.rb
wpscan-3.0.2 app/finders/plugins/comments.rb
wpscan-3.0.1 app/finders/plugins/comments.rb
wpscan-3.0 app/finders/plugins/comments.rb