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 |
# File 'lib/msf/base/simple/module.rb', line 18 def (opts) # If options were supplied, import them into the payload's # datastore if (opts['Options']) self.datastore.(opts['Options']) elsif (opts['OptionStr']) self.datastore.(opts['OptionStr']) end end |
#init_simplified(load_saved_config = true) ⇒ Object
Initializes the simplified interface.
35 36 37 |
# File 'lib/msf/base/simple/module.rb', line 35 def init_simplified(load_saved_config=true) load_config if load_saved_config end |
#inspect ⇒ Object
28 29 30 |
# File 'lib/msf/base/simple/module.rb', line 28 def inspect "#<Module:#{self.fullname} datastore=[#{self.datastore.inspect}]>" end |
#load_config ⇒ Object
Populates the datastore from the config file.
42 43 44 |
# File 'lib/msf/base/simple/module.rb', line 42 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.
49 50 51 |
# File 'lib/msf/base/simple/module.rb', line 49 def save_config self.datastore.to_file(Msf::Config.config_file, self.refname) end |