Class: WPScan::Finders::WpVersion::MetaGenerator

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

Overview

Meta Generator Version Finder

Instance Method Summary collapse

Instance Method Details

#passive(_opts = {}) ⇒ WpVersion

Returns:



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/finders/wp_version/meta_generator.rb', line 7

def passive(_opts = {})
  target.homepage_res.html.css('meta[name="generator"]').each do |node|
    next unless node.attribute('content').to_s =~ /wordpress ([0-9\.]+)/i

    number = Regexp.last_match(1)

    next unless WPScan::WpVersion.valid?(number)

    return WPScan::WpVersion.new(
      number,
      found_by: 'Meta Generator (Passive detection)',
      confidence: 80,
      interesting_entries: ["#{target.url}, Match: '#{node.to_s.strip}'"]
    )
  end
  nil
end