Class: WPScan::Finders::WpVersion::AtomGenerator

Inherits:
CMSScanner::Finders::Finder
  • Object
show all
Includes:
Finder::WpVersion::SmartURLChecker
Defined in:
app/finders/wp_version/atom_generator.rb

Overview

Atom Generator Version Finder

Instance Method Summary collapse

Methods included from Finder::WpVersion::SmartURLChecker

#create_version

Instance Method Details

#aggressive_urls(_opts = {}) ⇒ Object



32
33
34
35
36
# File 'app/finders/wp_version/atom_generator.rb', line 32

def aggressive_urls(_opts = {})
  %w(feed/atom/ ?feed=atom).reduce([]) do |a, uri|
    a << target.url(uri)
  end
end

#passive_urls_xpathObject



28
29
30
# File 'app/finders/wp_version/atom_generator.rb', line 28

def passive_urls_xpath
  '//link[@rel="alternate" and @type="application/atom+xml"]'
end

#process_urls(urls, _opts = {}) ⇒ Object



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

def process_urls(urls, _opts = {})
  found = Findings.new

  urls.each do |url|
    res = Browser.get_and_follow_location(url)

    res.html.css('generator').each do |node|
      next unless node.text.to_s.strip.casecmp('wordpress').zero?

      found << create_version(
        node['version'],
        found_by: found_by,
        entries: ["#{res.effective_url}, #{node.to_s.strip}"]
      )
    end
  end

  found
end