Class: Msf::RPC::JSON::V1_0::RpcCommand
- Inherits:
-
RpcCommand
- Object
- RpcCommand
- Msf::RPC::JSON::V1_0::RpcCommand
- Defined in:
- lib/msf/core/rpc/json/v1_0/rpc_command.rb
Constant Summary collapse
- METHOD_GROUP_SEPARATOR =
'.'
- MODULE_EXECUTE_KEY =
'module.execute'
- PAYLOAD_MODULE_TYPE_KEY =
'payload'
- PAYLOAD_KEY =
'payload'
Instance Attribute Summary
Attributes inherited from RpcCommand
Instance Method Summary collapse
-
#execute(method, params) ⇒ Object
Invokes the method on the receiver object with the specified params, returning the method’s return value.
-
#initialize(framework, execute_timeout: 7200) ⇒ RpcCommand
constructor
Instantiate an RpcCommand.
- #register_method(method, name: nil) ⇒ Object
Constructor Details
#initialize(framework, execute_timeout: 7200) ⇒ RpcCommand
Instantiate an RpcCommand.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/msf/core/rpc/json/v1_0/rpc_command.rb', line 15 def initialize(framework, execute_timeout: 7200) super(framework, execute_timeout: execute_timeout) # The legacy Msf::RPC::Service will not be started, however, it will be used to proxy # requests to existing handlers. This frees the command from having to act as the # service to RPC_Base subclasses and expose accessors for tokens and users. @legacy_rpc_service = ::Msf::RPC::Service.new(@framework, { execute_timeout: @execute_timeout }) end |
Instance Method Details
#execute(method, params) ⇒ Object
Invokes the method on the receiver object with the specified params, returning the method’s return value.
36 37 38 39 40 41 |
# File 'lib/msf/core/rpc/json/v1_0/rpc_command.rb', line 36 def execute(method, params) result = execute_internal(method, params) result = post_process_result(result, method, params) result end |
#register_method(method, name: nil) ⇒ Object
27 28 29 |
# File 'lib/msf/core/rpc/json/v1_0/rpc_command.rb', line 27 def register_method(method, name: nil) raise "#{self.class.name}##{__method__} is not implemented" end |