Sha256: efbafa255a8a99774a29137dc2918b1e21da28a613a9301278ca6788bbb9559c
Contents?: true
Size: 1.56 KB
Versions: 3
Compression:
Stored size: 1.56 KB
Contents
require_relative 'enumeration/cli_options' require_relative 'enumeration/enum_methods' module WPScan module Controller # Enumeration Controller class Enumeration < CMSScanner::Controller::Base def before_scan # Create the Dynamic PluginVersion Finders DB::DynamicPluginFinders.db_data.each do |name, config| %w[Comments].each do |klass| next unless config[klass] && config[klass]['version'] constant_name = name.tr('-', '_').camelize unless Finders::PluginVersion.constants.include?(constant_name.to_sym) Finders::PluginVersion.const_set(constant_name, Module.new) end mod = WPScan::Finders::PluginVersion.const_get(constant_name) raise "#{mod} has already a #{klass} class" if mod.constants.include?(klass.to_sym) case klass when 'Comments' then create_plugins_comments_finders(mod, config[klass]) end end end end def create_plugins_comments_finders(mod, config) mod.const_set( :Comments, Class.new(Finders::Finder::PluginVersion::Comments) do const_set(:PATTERN, config['pattern']) end ) end def run enum = parsed_options[:enumerate] || {} enum_plugins if enum_plugins?(enum) enum_themes if enum_themes?(enum) %i[timthumbs config_backups medias].each do |key| send("enum_#{key}".to_sym) if enum.key?(key) end enum_users if enum_users?(enum) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
wpscan-3.0.8 | app/controllers/enumeration.rb |
wpscan-3.0.7 | app/controllers/enumeration.rb |
wpscan-3.0.6 | app/controllers/enumeration.rb |