Skip to main content
Glama

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/

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes
fdnumYes
newfileYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the tool replaces/redirects a file descriptor, implying a write operation, but does not disclose side effects (e.g., whether the original fd is closed, permissions required, error handling, or if the process must be stopped). The description lacks behavioral details critical for safe use.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise: a one-sentence purpose followed by brief parameter explanations and a link to documentation. Essential information is front-loaded. However, it could be slightly tighter by removing the pwndbg command and source lines (which are less actionable for an AI).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description explains the tool's action and parameters adequately given the tool's low complexity (3 parameters, no enums, output schema exists). However, it lacks context about error states, prerequisites (e.g., process must be running, fd must be open), and what the output contains. For a mutation tool, this is not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% (no descriptions in input schema), so the description must add meaning. It explains each parameter: session_id is a UUID, fdnum is the file descriptor number, newfile is a new file path or socket specification. This clarifies the purpose of each parameter beyond the schema's titles and types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Replace'/'Redirects') and the resource ('file descriptor of the debugged process'), and distinguishes the tool's action from the many sibling tools (e.g., pwndbg_breakpoint_list, pwndbg_mprotect) by focusing on file descriptor hijacking for exploitation. The mention of redirecting stdin/stdout/stderr adds specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions the tool is 'useful for redirecting stdin/stdout/stderr during exploitation', giving a usage context. However, it does not specify when not to use the tool or mention alternatives (e.g., using pwndbg_patch for memory patching). The guidance is implied but not explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Micro-Evaluation-Group/pwndbg-lldb-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server