Sha256: 6c675f3a55952b209b5a7b395c83736b0e4c3d9322cac69c2bedd240d04bc757

Contents?: true

Size: 1.28 KB

Versions: 5

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

require_relative 'wp_version/rss_generator'
require_relative 'wp_version/atom_generator'
require_relative 'wp_version/rdf_generator'
require_relative 'wp_version/readme'
require_relative 'wp_version/unique_fingerprinting'

module WPScan
  module Finders
    # Specific Finders container to filter the version detected
    # and remove the one with low confidence to avoid false
    # positive when there is not enought information to accurately
    # determine it.
    class WpVersionFinders < UniqueFinders
      def filter_findings
        best_finding = super

        best_finding && best_finding.confidence >= 40 ? best_finding : false
      end
    end

    module WpVersion
      # Wp Version Finder
      class Base
        include CMSScanner::Finders::UniqueFinder

        # @param [ WPScan::Target ] target
        def initialize(target)
          (%w[RSSGenerator AtomGenerator RDFGenerator] +
           WPScan::DB::DynamicFinders::Wordpress.versions_finders_configs.keys +
           %w[Readme UniqueFingerprinting]
          ).each do |finder_name|
            finders << WpVersion.const_get(finder_name.to_sym).new(target)
          end
        end

        def finders
          @finders ||= Finders::WpVersionFinders.new
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wpscan-3.5.4 app/finders/wp_version.rb
wpscan-3.5.3 app/finders/wp_version.rb
wpscan-3.5.2 app/finders/wp_version.rb
wpscan-3.5.1 app/finders/wp_version.rb
wpscan-3.5.0 app/finders/wp_version.rb