Class: WPScan::Finders::PluginVersion::LayerSlider::TranslationFile

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

Overview

Version from a Translation file

See github.com/wpscanteam/wpscan/issues/765

Instance Method Summary collapse

Instance Method Details

#aggressive(_opts = {}) ⇒ Version

Parameters:

  • opts (Hash)

Returns:

  • (Version)


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

def aggressive(_opts = {})
  potential_urls.each do |url|
    res = Browser.get(url)

    next unless res.code == 200 && res.body =~ /Project-Id-Version: LayerSlider WP v?([0-9\.][^\\\s]+)/

    return WPScan::Version.new(
      Regexp.last_match[1],
      found_by: 'Translation File (Aggressive Detection)',
      confidence: 90,
      interesting_entries: ["#{url}, Match: '#{Regexp.last_match}'"]
    )
  end
  nil
end

#potential_urlsArray<String>

Returns The potential URLs where the version is disclosed.

Returns:

  • (Array<String>)

    The potential URLs where the version is disclosed



29
30
31
32
33
34
35
# File 'app/finders/plugin_version/layer_slider/translation_file.rb', line 29

def potential_urls
  # Recent versions seem to use the 'locales' directory instead of the 'languages' one.
  # Maybe also check other locales ?
  %w[locales languages].reduce([]) do |a, e|
    a << target.url("#{e}/LayerSlider-en_US.po")
  end
end