Sha256: 3772f1378d24cab48e9364fcff2094ce280e8a70490141e2401325a9337ff670

Contents?: true

Size: 1.07 KB

Versions: 9

Compression:

Stored size: 1.07 KB

Contents

module WPScan
  module Finders
    module Plugins
      # Plugins from Headers Finder
      class Headers < CMSScanner::Finders::Finder
        # @param [ Hash ] opts
        #
        # @return [ Array<Plugin> ]
        def passive(opts = {})
          plugin_names_from_headers(opts).reduce([]) do |a, e|
            a << WPScan::Plugin.new(e, target, opts.merge(found_by: found_by, confidence: 60))
          end
        end

        # X-Powered-By: W3 Total Cache/0.9.2.5
        # WP-Super-Cache: Served supercache file from PHP
        #
        # @return [ Array<String> ]
        def plugin_names_from_headers(_opts = {})
          found   = []
          headers = target.homepage_res.headers

          if headers
            powered_by     = headers['X-Powered-By'].to_s
            wp_super_cache = headers['wp-super-cache'].to_s

            found << 'w3-total-cache' if powered_by =~ Finders::PluginVersion::W3TotalCache::Headers::PATTERN
            found << 'wp-super-cache' if wp_super_cache =~ /supercache/i
          end

          found
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wpscan-3.0.8 app/finders/plugins/headers.rb
wpscan-3.0.7 app/finders/plugins/headers.rb
wpscan-3.0.6 app/finders/plugins/headers.rb
wpscan-3.0.5 app/finders/plugins/headers.rb
wpscan-3.0.4 app/finders/plugins/headers.rb
wpscan-3.0.3 app/finders/plugins/headers.rb
wpscan-3.0.2 app/finders/plugins/headers.rb
wpscan-3.0.1 app/finders/plugins/headers.rb
wpscan-3.0 app/finders/plugins/headers.rb