Practice library / Exploit development and reversing
Lab · Hard · 3 hoursFree account
Return Oriented Programming (ROP)
Bypass NX/DEP with ROP gadget chains, ret2libc, and ASLR defeat via info leaks.
On this page 5 sections
Before you start
Return Oriented Programming chains tiny code pieces, called gadgets, from the target binary to run attacker logic without injecting new code. DEP and NX stop classic shellcode on the stack, so modern exploits lean on ROP to reach system() or disable protections first. You build a working ret2libc chain, then defeat ASLR with a puts leak, and script it all with pwntools.
Lab Objectives
- Understand why NX/DEP makes traditional shellcode injection impossible
- Find ROP gadgets with ROPgadget and ropper
- Build a basic ROP chain manually
- Perform a ret2libc attack to call system("/bin/sh") without ASLR
- Use a printf/puts leak to defeat ASLR in a two-stage exploit
- Write a complete exploit script using pwntools
Topics Covered
- DEP/NX protection — why shellcode no longer works directly
- Return-oriented programming — chaining gadget sequences
- Gadget types: pop/ret, mov, syscall, ret
- Finding gadgets in the binary and libc
- ret2libc technique without ASLR
- ASLR bypass via information leaks (leak libc base)
Sign in to continue
4 more sections are for signed-in members. It is free: sign in with Google.