Sha256: 6230ca80a6bf3f96ade67e7d94b4d962f30e287dcfe7327813f195b9f506be34

Contents?: true

Size: 956 Bytes

Versions: 6

Compression:

Stored size: 956 Bytes

Contents

# frozen_string_literal: true

require_relative 'plugin_version/readme'

module WPScan
  module Finders
    module PluginVersion
      # Plugin Version Finder
      class Base
        include CMSScanner::Finders::UniqueFinder

        # @param [ Model::Plugin ] plugin
        def initialize(plugin)
          finders << PluginVersion::Readme.new(plugin)

          load_specific_finders(plugin)
        end

        # Load the finders associated with the plugin
        #
        # @param [ Model::Plugin ] plugin
        def load_specific_finders(plugin)
          module_name = plugin.classify

          return unless Finders::PluginVersion.constants.include?(module_name)

          mod = Finders::PluginVersion.const_get(module_name)

          mod.constants.each do |constant|
            c = mod.const_get(constant)

            next unless c.is_a?(Class)

            finders << c.new(plugin)
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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