Courses3 levels
Level 1 · Foundations11 courses
Level 2 · Core5 courses
Level 3 · Advanced5 courses
Labs8 topics
Library Practice exams AI Range Pricing Start free

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.

  • rop
  • ret2libc
  • dep-nx
  • aslr
  • exploit-development
On this page 5 sections
  1. ·Topics Covered
  2. Locked: Why ROP?
  3. Locked: Finding Gadgets
  4. Locked: ret2libc Without ASLR
  5. Locked: Defeating ASLR With a Libc Leak

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.

Related