MCPcopy Create free account
hub / github.com/GH05TCREW/MetasploitMCP / get_msf_client

Function get_msf_client

MetasploitMCP.py:106–112  ·  view source on GitHub ↗

Gets the initialized MSF client instance, raising an error if not ready.

()

Source from the content-addressed store, hash-verified

104 raise RuntimeError(f"Unexpected error initializing MSF client: {e}") from e
105
106def get_msf_client() -> MsfRpcClient:
107 """Gets the initialized MSF client instance, raising an error if not ready."""
108 if _msf_client_instance is None:
109 logger.error("Metasploit client has not been initialized. Check MSF server connection.")
110 raise ConnectionError("Metasploit client has not been initialized.") # Strict check preferred
111 logger.debug("Retrieved MSF client instance successfully.")
112 return _msf_client_instance
113
114async def check_msf_connection() -> Dict[str, Any]:
115 """

Callers 15

check_msf_connectionFunction · 0.85
get_msf_consoleFunction · 0.85
_get_module_objectFunction · 0.85
_execute_module_rpcFunction · 0.85
list_exploitsFunction · 0.85
list_payloadsFunction · 0.85
generate_payloadFunction · 0.85
run_post_moduleFunction · 0.85
list_active_sessionsFunction · 0.85
send_session_commandFunction · 0.85

Calls

no outgoing calls