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
# File 'lib/msf/core/module/options.rb', line 30

def deregister_options(*names)
  names.each { |name|
    real_name = self.datastore.find_key_case(name)
    self.datastore.delete(name)
    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.


46
47
48
49
50
# File 'lib/msf/core/module/options.rb', line 46

def register_advanced_options(options, owner = self.class)
  self.options.add_advanced_options(options, owner)
  self.datastore.import_options(self.options, 'self', true)
  import_defaults(false)
end

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

Register evasion options with a specific owning class.


55
56
57
58
59
# File 'lib/msf/core/module/options.rb', line 55

def register_evasion_options(options, owner = self.class)
  self.options.add_evasion_options(options, owner)
  self.datastore.import_options(self.options, 'self', true)
  import_defaults(false)
end

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

Register options with a specific owning class.


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

def register_options(options, owner = self.class)
  self.options.add_options(options, owner)
  self.datastore.import_options(self.options, 'self', true)
  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