ROPgadget

7.7 · active · verified Thu Apr 16

ROPgadget is a Python tool designed to search for ROP (Return-Oriented Programming) gadgets within binary files. It supports various file formats (ELF, PE, Mach-O, Raw) and architectures, including x86, x64, ARM, ARM64, PowerPC, SPARC, MIPS, RISC-V 64, and RISC-V Compressed. Currently at version 7.7, the project is actively maintained with several releases per year addressing bug fixes and adding support for new architectures and features.

Common errors

Warnings

Install

Imports

Quickstart

ROPgadget is primarily a command-line utility. This quickstart demonstrates how to search for common 'pop; ret' gadgets in a binary and how to attempt to generate a ROP chain (though successful chain generation depends heavily on the binary and environment).

# Analyze a binary for ROP gadgets
ROPgadget --binary /bin/ls --only "pop|ret" --depth 3

# Find a ROP chain to execute /bin/sh (example)
# Note: Actual binaries and gadgets will vary. This is a conceptual example.
# Assuming a vulnerable binary `vuln` exists in the current directory
ROPgadget --binary ./vuln --ropchain --badbytes "000a0d" --rawArch x64 --offset 0x0 --callPreceded

view raw JSON →