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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| timeout | No | ||
| session_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||