Skip to main content
Glama

pwndbg_onegadget

Search for single-gadget RCE paths in libc that call execve('/bin/sh') to gain a shell by overwriting a function pointer.

Instructions

Find one-gadget (magic gadget) RCE gadgets in libc.

pwndbg command: onegadget Source: pwndbg/commands/onegadget.py Category: Linux/libc/ELF Arch: x86-64, i386, aarch64

Searches for single-gadget code paths in libc that directly call execve("/bin/sh", ...). These are the holy grail for exploitation since overwriting a single function pointer gives a shell.

Args: session_id: The UUID of the session. verbose: If True, show constraint details.

See: https://pwndbg.re/2025.05.30/reference/pwndbg/commands/onegadget/

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes
verboseNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description carries full disclosure burden. It mentions supported architectures (x86-64, i386, aarch64) and the source file, but does not describe output format, whether the tool modifies state, or if it requires libc base address. The behavioral implications of verbose mode are only vaguely hinted at ('constraint details').

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 well-structured: a one-line purpose, then source/category/arch metadata, then a clear explanation, then args. It is front-loaded with the core verb and noun. No unnecessary sentences, though the source line is redundant for agent understanding.

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?

For a two-parameter tool with an output schema, the description covers basic usage and purpose. However, it omits context about when the session must have libc loaded, error conditions, or what the output contains (though output schema may cover that). Given the low schema coverage, more context would be beneficial.

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%, so the description's parameter section adds essential meaning: it defines session_id as 'UUID of the session' and verbose as 'show constraint details'. This supplements the bare schema (string and boolean types) effectively, though it could be more precise about the verbose parameter's effect.

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 tool finds 'one-gadget (magic gadget) RCE gadgets in libc' and explains they are single-gadget code paths calling execve("/bin/sh"). This is a specific verb-resource pair, distinct from siblings like pwndbg_rop or pwndbg_search. The purpose is immediately understood.

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 implies use when searching for RCE gadgets in libc, but it lacks explicit guidance on when to use versus alternatives, such as pwndbg_rop or pwndbg_leakfind. No prerequisites or when-not-to-use instructions are provided, leaving the agent to infer context from the tool's name and category.

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