Sha256: 0c63806ecb179d562fd5e515804a49f598c050d5659ecd8f2d27d522880900a4

Contents?: true

Size: 1015 Bytes

Versions: 17

Compression:

Stored size: 1015 Bytes

Contents

# frozen_string_literal: true

module WPScan
  module Finders
    module WpVersion
      # RDF Generator Version Finder
      class RDFGenerator < CMSScanner::Finders::Finder
        include Finder::WpVersion::SmartURLChecker

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

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

            res.html.xpath('//generatoragent').each do |node|
              next unless node['rdf:resource'] =~ %r{\Ahttps?://wordpress\.(?:[a-z.]+)/\?v=(.*)\z}i

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

          found
        end

        def passive_urls_xpath
          '//a[contains(@href, "rdf")]/@href'
        end

        def aggressive_urls(_opts = {})
          [target.url('feed/rdf/')]
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
wpscan-3.7.6 app/finders/wp_version/rdf_generator.rb
wpscan-3.7.5 app/finders/wp_version/rdf_generator.rb
wpscan-3.7.4 app/finders/wp_version/rdf_generator.rb
wpscan-3.7.3 app/finders/wp_version/rdf_generator.rb
wpscan-3.7.2 app/finders/wp_version/rdf_generator.rb
wpscan-3.7.1 app/finders/wp_version/rdf_generator.rb
wpscan-3.7.0 app/finders/wp_version/rdf_generator.rb
wpscan-3.6.3 app/finders/wp_version/rdf_generator.rb
wpscan-3.6.2 app/finders/wp_version/rdf_generator.rb
wpscan-3.6.1 app/finders/wp_version/rdf_generator.rb
wpscan-3.6.0 app/finders/wp_version/rdf_generator.rb
wpscan-3.5.5 app/finders/wp_version/rdf_generator.rb
wpscan-3.5.4 app/finders/wp_version/rdf_generator.rb
wpscan-3.5.3 app/finders/wp_version/rdf_generator.rb
wpscan-3.5.2 app/finders/wp_version/rdf_generator.rb
wpscan-3.5.1 app/finders/wp_version/rdf_generator.rb
wpscan-3.5.0 app/finders/wp_version/rdf_generator.rb