read_output
Read output from any active interactive session by its ID. Configurable timeout waits for new output before returning the collected text.
Instructions
Read / poll output from any active interactive session by its ID. Works with msfconsole, SSH, mysql, python REPL, shell, or any other session type managed by the backend.
Typical workflow:
send_input(session_id, "whoami\n")
read_output(session_id, timeout=5) -> returns the command's output
The backend will wait up to timeout seconds for new output before
returning whatever is available (which may be empty if the process has
not produced anything yet).
Args: session_id: The session identifier to read from. timeout: Maximum seconds the backend should wait for new output before returning (default: 5). Use a higher value for slow commands (e.g. nmap, compilation). lines: Maximum number of output lines to return (default: 100). Older lines are trimmed first when the buffer exceeds this.
Returns: dict with at minimum: - success (bool): whether the read succeeded - output (str): the collected output text - session_id (str): echo of the session targeted - lines_returned (int): number of lines in output - error (str, optional): present only on failure
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | No | ||
| timeout | No | ||
| session_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |