Class: Msf::MCP::Metasploit::Client

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/msf/core/mcp/metasploit/client.rb

Overview

Client facade that routes to the appropriate protocol implementation Supports MessagePack RPC (Metasploit’s native protocol) and JSON-RPC

Instance Method Summary collapse

Constructor Details

#initialize(api_type:, host:, port:, endpoint: nil, token: nil, ssl: true) ⇒ Client

Initialize Metasploit client with explicit parameters

Parameters:

  • api_type (String)

    API type: ‘messagepack’ or ‘json-rpc’

  • host (String)

    Metasploit host

  • port (Integer)

    Metasploit port

  • endpoint (String) (defaults to: nil)

    API endpoint path

  • token (String, nil) (defaults to: nil)

    API token (for json-rpc)

  • ssl (Boolean) (defaults to: true)

    Use SSL (default: true)



24
25
26
# File 'lib/msf/core/mcp/metasploit/client.rb', line 24

def initialize(api_type:, host:, port:, endpoint: nil, token: nil, ssl: true)
  @client = create_client(api_type: api_type, host: host, port: port, endpoint: endpoint, token: token, ssl: ssl)
end