A command-line tool that finds one-gadget RCE (execve('/bin/sh')) offsets in libc binaries for CTF pwn challenges.
OneGadget is a Ruby gem and command-line tool that automatically finds 'one-gadget' remote code execution sequences in libc libraries. It identifies offsets that, when jumped to, execute `execve('/bin/sh', NULL, NULL)` to spawn a shell. This solves the problem of manually searching through disassembled libc binaries for usable RCE gadgets during CTF pwn challenges.
CTF players, binary exploitation enthusiasts, and security researchers who participate in or study pwn (binary exploitation) challenges, particularly those involving libc and RCE.
Developers choose OneGadget because it dramatically speeds up the gadget-finding process compared to manual disassembly, supports multiple architectures, intelligently filters gadgets by exploitability, and offers features like BuildID lookup and script integration for automated testing.
The best tool for finding one gadget RCE in libc.so.6
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Scans libc binaries to find all possible one-gadget offsets, eliminating the need for manual disassembly with tools like objdump, as shown in the README's command-line examples.
Ranks gadgets by the difficulty of their runtime constraints and defaults to showing only the most likely to succeed, helping users prioritize exploitable options efficiently.
Works with i386, amd64 (x86-64), and aarch64 (ARMv8) libc binaries, covering common architectures in CTF challenges, demonstrated through output examples for each.
Can search gadgets using libc's BuildID hash and automatically test them with user-provided exploit scripts via the -s flag, streamlining the exploitation workflow.
Only supports i386, amd64, and aarch64, missing other common CTF architectures like ARMv7 or MIPS, which restricts its utility in broader binary exploitation contexts.
Requires Ruby version >=2.1.0 and installation via gem, which can be a barrier in environments without Ruby or where system dependencies are tightly controlled.
The README admits it may fail on some libc versions and asks users to report failures, indicating reliability isn't guaranteed across all library builds or updates.
Default filtering hides less probable gadgets, requiring users to manually increase the output level with --level, which can lead to information overload or missed opportunities if not adjusted.