Class: WPScan::Finders::PluginVersion::SitepressMultilingualCms::VersionParameter

Inherits:
CMSScanner::Finders::Finder
  • Object
show all
Defined in:
app/finders/plugin_version/sitepress_multilingual_cms/version_parameter.rb

Overview

Version from the v parameter in href / src of stylesheets / scripts

Instance Method Summary collapse

Instance Method Details

#passive(_opts = {}) ⇒ Version

Parameters:

  • opts (Hash)

Returns:

  • (Version)


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/finders/plugin_version/sitepress_multilingual_cms/version_parameter.rb', line 10

def passive(_opts = {})
  pattern = %r{#{Regexp.escape(target.target.plugins_dir)}/sitepress-multilingual-cms/}i

  target.target.in_scope_urls(target.target.homepage_res, '//link|//script') do |url|
    uri = Addressable::URI.parse(url)

    next unless uri.path =~ pattern && uri.query =~ /v=([0-9\.]+)/

    return WPScan::Version.new(
      Regexp.last_match[1],
      found_by: found_by,
      confidence: 50,
      interesting_entries: [url]
    )
  end
  nil
end