Class: WPScan::Finders::WpVersion::AtomGenerator
- Inherits:
-
CMSScanner::Finders::Finder
- Object
- CMSScanner::Finders::Finder
- WPScan::Finders::WpVersion::AtomGenerator
- Includes:
- Finder::WpVersion::SmartURLChecker
- Defined in:
- app/finders/wp_version/atom_generator.rb
Overview
Atom Generator Version Finder
Instance Method Summary collapse
- #aggressive_urls(_opts = {}) ⇒ Object
- #passive_urls_xpath ⇒ Object
- #process_urls(urls, _opts = {}) ⇒ Object
Methods included from Finder::WpVersion::SmartURLChecker
Instance Method Details
#aggressive_urls(_opts = {}) ⇒ Object
34 35 36 37 38 |
# File 'app/finders/wp_version/atom_generator.rb', line 34 def aggressive_urls(_opts = {}) %w[feed/atom/ ?feed=atom].reduce([]) do |a, uri| a << target.url(uri) end end |
#passive_urls_xpath ⇒ Object
30 31 32 |
# File 'app/finders/wp_version/atom_generator.rb', line 30 def passive_urls_xpath '//link[@rel="alternate" and @type="application/atom+xml"]/@href' end |
#process_urls(urls, _opts = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/finders/wp_version/atom_generator.rb', line 10 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 |