Class: WPScan::Finders::Plugins::Comments

Inherits:
CMSScanner::Finders::Finder
  • Object
show all
Defined in:
app/finders/plugins/comments.rb

Overview

Plugins from Comments Finder

Instance Method Summary collapse

Instance Method Details

#passive(opts = {}) ⇒ Array<Plugin>

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :unique (Boolean)

    Default: true

Returns:



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/finders/plugins/comments.rb', line 10

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