Class: WPScan::Finders::Finder::PluginVersion::Comments

Inherits:
CMSScanner::Finders::Finder
  • Object
show all
Defined in:
lib/wpscan/finders/finder/plugin_version/comments.rb

Overview

Plugin Version from the Comments in the homepage, used in dynamic PluginVersion finders

Instance Method Summary collapse

Instance Method Details

#passive(_opts = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/wpscan/finders/finder/plugin_version/comments.rb', line 7

def passive(_opts = {})
  target.target.comments_from_page(self.class::PATTERN) do |match|
    # Avoid nil version, i.e a pattern allowing both versionable and non
    # versionable string to be detected

    next unless match[1]

    return WPScan::Version.new(
      match[1],
      found_by: found_by,
      confidence: 80,
      interesting_entries: ["#{target.target.url}, Match: '#{match}'"]
    )
  end
  nil # In case nothing is found, otherwise the latest match is returned and cause problems
end