Class: Msf::Modules::External
- Inherits:
-
Object
- Object
- Msf::Modules::External
- Defined in:
- lib/msf/core/modules/external.rb,
lib/msf/core/modules/external/bridge.rb
Overview
Namespace for loading external Metasploit modules
Defined Under Namespace
Modules: CLI Classes: Bridge, GoBridge, Message, PyBridge, RbBridge, Shim
Instance Attribute Summary collapse
-
#framework ⇒ Object
protected
Returns the value of attribute framework.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #describe ⇒ Object protected
- #exec(method: :run, args: {}, &block) ⇒ Object
-
#initialize(module_path, framework: nil) ⇒ External
constructor
A new instance of External.
- #meta ⇒ Object
Constructor Details
#initialize(module_path, framework: nil) ⇒ External
Returns a new instance of External.
16 17 18 19 |
# File 'lib/msf/core/modules/external.rb', line 16 def initialize(module_path, framework: nil) self.path = module_path self.framework = framework end |
Instance Attribute Details
#framework ⇒ Object (protected)
Returns the value of attribute framework.
44 45 46 |
# File 'lib/msf/core/modules/external.rb', line 44 def framework @framework end |
#path ⇒ Object
Returns the value of attribute path.
10 11 12 |
# File 'lib/msf/core/modules/external.rb', line 10 def path @path end |
Instance Method Details
#describe ⇒ Object (protected)
46 47 48 49 50 51 |
# File 'lib/msf/core/modules/external.rb', line 46 def describe exec method: :describe do |msg| return msg.params if msg.method == :reply end return nil end |
#exec(method: :run, args: {}, &block) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/msf/core/modules/external.rb', line 21 def exec(method: :run, args: {}, &block) req = Message.new(method) req.params = args.dup b = Bridge.open(self.path, framework: self.framework).exec(req) if block begin while m = b..pop block.call m end ensure b.close end return b.success? else return b end end |
#meta ⇒ Object
12 13 14 |
# File 'lib/msf/core/modules/external.rb', line 12 def @meta ||= describe end |