pwndbg_hijack_fd
Redirect any open file descriptor to a new file or socket, enabling stdin/stdout/stderr manipulation during exploit development.
Instructions
Replace a file descriptor of the debugged process.
pwndbg command: hijack-fd Source: pwndbg/commands/hijack_fd.py Category: Misc
Redirects an open file descriptor to a new file or socket, useful for redirecting stdin/stdout/stderr during exploitation.
Args: session_id: The UUID of the session. fdnum: File descriptor number to replace. newfile: New file path or socket specification.
See: https://pwndbg.re/2025.05.30/reference/pwndbg/commands/hijack_fd/
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>",
"fdnum": "<fdnum>",
"newfile": "<newfile>"
},
"name": "pwndbg_hijack_fd"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | ||
| fdnum | Yes | ||
| newfile | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |