Module: Msf::Simple::Module
- Defined in:
- lib/msf/base/simple/module.rb
Overview
Simple module wrapper that provides some common methods for dealing with modules, such as importing options and other such things.
Instance Method Summary collapse
-
#_import_extra_options(opts) ⇒ Object
Imports extra options from the supplied hash either as a string or as a hash.
-
#init_simplified(load_saved_config = true) ⇒ Object
Initializes the simplified interface.
- #inspect ⇒ Object
-
#load_config ⇒ Object
Populates the datastore from the config file.
-
#save_config ⇒ Object
Saves the module’s datastore to the file.
Instance Method Details
#_import_extra_options(opts) ⇒ Object
Imports extra options from the supplied hash either as a string or as a hash.
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/msf/base/simple/module.rb', line 18 def (opts) # If options were supplied, import them into the payload's # datastore if (value = opts['Options']) if value.is_a?(String) self.datastore.(value) else self.datastore.(value) end elsif (value = opts['OptionStr']) self.datastore.(value) end end |
#init_simplified(load_saved_config = true) ⇒ Object
Initializes the simplified interface.
39 40 41 |
# File 'lib/msf/base/simple/module.rb', line 39 def init_simplified(load_saved_config=true) load_config if load_saved_config end |
#inspect ⇒ Object
32 33 34 |
# File 'lib/msf/base/simple/module.rb', line 32 def inspect "#<Module:#{self.fullname} datastore=[#{self.datastore.inspect}]>" end |
#load_config ⇒ Object
Populates the datastore from the config file.
46 47 48 |
# File 'lib/msf/base/simple/module.rb', line 46 def load_config self.datastore.from_file(Msf::Config.config_file, self.refname) end |
#save_config ⇒ Object
Saves the module’s datastore to the file.
53 54 55 |
# File 'lib/msf/base/simple/module.rb', line 53 def save_config self.datastore.to_file(Msf::Config.config_file, self.refname) end |