msf_session_cmd
Execute a command on an active Metasploit session (shell or Meterpreter) by providing the session ID and command. Set an optional timeout to control wait time.
Instructions
Execute a command on an active Metasploit session (shell or Meterpreter).
WARNING: This is a destructive operation that executes commands on a compromised system. Requires explicit authorization.
Args: session_id: Active session ID (e.g. "1", "2"). Only digits are accepted. command: Command to execute (e.g. "id", "whoami", "cat /etc/shadow"). timeout: Maximum seconds to wait for output (default: 30).
Returns: Command output with session type and session ID.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"session_id": "<session_id>",
"command": "<command>"
},
"name": "msf_session_cmd"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| timeout | No | ||
| session_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||