Module: Msf::Module::Options

Included in:
Msf::Module
Defined in:
lib/msf/core/module/options.rb

Overview

Register, deregister, and validate #options.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



9
10
11
# File 'lib/msf/core/module/options.rb', line 9

def options
  @options
end

Instance Method Details

#deregister_options(*names) ⇒ Object (protected)

Removes the supplied options from the module’s option container and data store.



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/msf/core/module/options.rb', line 30

def deregister_options(*names)
  names.each { |name|
    real_name = self.datastore.find_key_case(name)
    if self.datastore.is_a?(Msf::DataStoreWithFallbacks)
      self.datastore.remove_option(name)
    else
      self.datastore.delete(name)
    end
    self.options.remove_option(name)
    if real_name != name
      self.options.remove_option(real_name)
    end
  }
end

#register_advanced_options(options, owner = self.class) ⇒ Object (protected)

Register advanced options with a specific owning class.



50
51
52
53
# File 'lib/msf/core/module/options.rb', line 50

def register_advanced_options(options, owner = self.class)
  self.options.add_advanced_options(options, owner)
  import_defaults(false)
end

#register_evasion_options(options, owner = self.class) ⇒ Object (protected)

Register evasion options with a specific owning class.



58
59
60
61
# File 'lib/msf/core/module/options.rb', line 58

def register_evasion_options(options, owner = self.class)
  self.options.add_evasion_options(options, owner)
  import_defaults(false)
end

#register_options(options, owner = self.class) ⇒ Object (protected)

Register options with a specific owning class.



66
67
68
69
# File 'lib/msf/core/module/options.rb', line 66

def register_options(options, owner = self.class)
  self.options.add_options(options, owner)
  import_defaults(false)
end

#validateObject

This method ensures that the options associated with this module all have valid values according to each required option in the option container.



20
21
22
# File 'lib/msf/core/module/options.rb', line 20

def validate
  self.options.validate(self.datastore)
end