Sha256: dac2986a1ffd95921611f060fa2eeaabb3c281eecf68868f5e1d4362a949b572

Contents?: true

Size: 1.09 KB

Versions: 13

Compression:

Stored size: 1.09 KB

Contents

module WPScan
  module Finders
    module Plugins
      # Plugins finder from Dynamic Finder 'HeaderPattern'
      class HeaderPattern < WPScan::Finders::DynamicFinder::WpItems::Finder
        DEFAULT_CONFIDENCE = 30

        # @param [ Hash ] opts
        #
        # @return [ Array<Plugin> ]
        def passive(opts = {})
          found = []
          headers = target.homepage_res.headers

          return found if headers.empty?

          DB::DynamicFinders::Plugin.passive_header_pattern_finder_configs.each do |slug, configs|
            configs.each do |klass, config|
              next unless headers[config['header']] && headers[config['header']].to_s =~ config['pattern']

              found << Plugin.new(
                slug,
                target,
                opts.merge(found_by: found_by(klass), confidence: config['confidence'] || DEFAULT_CONFIDENCE)
              )
            end
          end

          found
        end

        # @param [ Hash ] opts
        #
        # @return [ nil ]
        def aggressive(_opts = {})
          # None
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
wpscan-3.4.5 app/finders/plugins/header_pattern.rb
wpscan-3.4.4 app/finders/plugins/header_pattern.rb
wpscan-3.4.3 app/finders/plugins/header_pattern.rb
wpscan-3.4.2 app/finders/plugins/header_pattern.rb
wpscan-3.4.1 app/finders/plugins/header_pattern.rb
wpscan-3.4.0 app/finders/plugins/header_pattern.rb
wpscan-3.3.3 app/finders/plugins/header_pattern.rb
wpscan-3.3.2 app/finders/plugins/header_pattern.rb
wpscan-3.3.1 app/finders/plugins/header_pattern.rb
wpscan-3.3.0 app/finders/plugins/header_pattern.rb
wpscan-3.2.1 app/finders/plugins/header_pattern.rb
wpscan-3.2.0 app/finders/plugins/header_pattern.rb
wpscan-3.1.0 app/finders/plugins/header_pattern.rb