one-gadget
Fast libc post-leak shortcut finder. Great when it works, humbling when constraints bite back.
When to use one-gadget
Use one-gadget when you need to:
- turn a libc base leak into candidate
execveoffsets - compare several constraint-heavy RCE options quickly
- decide whether a short stack/register fix-up beats a full custom chain
Quick Start
# Enumerate candidate gadgets in libc
one_gadget ./libc.so.6
# Show more gadgets and constraints
one_gadget -l 2 ./libc.so.6
# Raw offsets only
one_gadget --raw ./libc.so.6
Practical Workflow
- Identify the exact libc or a trustworthy build match.
- Compute the libc base from your leak.
- Run
one_gadgeton that libc file. - Read the printed constraints carefully.
- Validate stack, registers, and writable memory in
gdbbefore betting the exploit on one offset.
Practical Notes
- Constraints are the whole game:
rspcontents,rax == NULL, or writable memory requirements often decide feasibility. one-gadgetis best after you already solved ASLR for libc.- Keep a normal ROP fallback path ready; many stable exploits start with
one-gadgetas a probe, not as the final design.
Caveats
- A valid offset does not imply a reachable or repeatable exploit path.
- Version drift between local and remote libc makes results meaningless.
- CET, seccomp, stack layout differences, or register clobbers often kill the magical one-shot path.
Resources
No bundled scripts/, references/, or assets/.
Use the upstream gem README for installation, constraint-depth controls, and supported libc assumptions.