Program Security

Return Oriented Programming

Picture yourself as a digital maestro, orchestrating a symphony of code in a vast digital realm. However, there’s a twist: you don’t get to pen down your own notes. Instead, you're given a legacy of existing code snippets, scattered across the system. This is the essence of Return Oriented Programming (ROP) exploits! Using nothing but the remnants of the system’s own code, you craft a cunning composition that dances to your own tune, bypassing modern security measures with elegance and stealth.

Each snippet is like a musical phrase, ending in a "return" instruction, whisking you off to the next snippet in your clandestine concerto. With each leap and bound, you weave a nefarious narrative, circumventing security checks and executing unauthorized actions, all while under the unsuspecting nose of the system’s defenses.

ROP is not just a hack; it’s a masterpiece of unauthorized orchestration, a ballet of borrowed instructions, choreographed with precision to achieve your clandestine objectives. With ROP, you step into a realm where every byte is a beat, and every return is a rhythm, embarking on an exhilarating journey of exploitation and discovery.

30 challenges

Return Oriented Programming Resources

Return Oriented Programming: Introduction

Return Oriented Programming: Binary Lego

Return Oriented Programming: Techniques

Return Oriented Programming: Complications

Calling Functions

CHALLENGE 01

Loose Link (Easy)

— solves

Overwrite a return address to trigger a win function!

CHALLENGE 02

Loose Link (Hard)

— solves

Overwrite a return address to trigger a win function!

CHALLENGE 03

Call Chain (Easy)

— solves

Use ROP to trigger a two-stage win function!

CHALLENGE 04

Call Chain (Hard)

— solves

Use ROP to trigger a two-stage win function!

CHALLENGE 05

Chain of Command (Easy)

— solves

Use ROP to trigger a multi-stage win function!

CHALLENGE 06

Chain of Command (Hard)

— solves

Use ROP to trigger a multi-stage win function!

Chaining Gadgets

CHALLENGE 07

Stop, Pop, and ROP (Easy)

— solves

Leverage a stack leak while crafting a ROP chain to obtain the flag!

CHALLENGE 08

Stop, Pop, and ROP (Hard)

— solves

Leverage a stack leak while crafting a ROP chain to obtain the flag!

CHALLENGE 09

Stop, Pop and ROP II (Easy)

— solves

Craft a ROP chain to obtain the flag, now with no stack leak!

CHALLENGE 10

Stop, Pop, and ROP II (Hard)

— solves

Craft a ROP chain to obtain the flag, now with no stack leak!

CHALLENGE 11

Indirect Invocation (Easy)

— solves

Craft a ROP chain to obtain the flag, now with no syscall gadget!

CHALLENGE 12

Indirect Invocation (Hard)

— solves

Craft a ROP chain to obtain the flag, now with no syscall gadget!

Leveraging Libc

CHALLENGE 13

Leaky Libc (Easy)

— solves

Utilize a libc leak to ROP with libc!

CHALLENGE 14

Leaky Libc (Hard)

— solves

Utilize a libc leak to ROP with libc!

CHALLENGE 15

Putsception (Easy)

— solves

ROP with libc, no free leak this time!

CHALLENGE 16

Putsception (Hard)

— solves

ROP with libc, no free leak this time!

Stack Pivoting Class Streams

Stack Pivoting Class Streams

Follow along with a live class with the same demo as the instructor!

Take it or Leave it - Livestream

CHALLENGE 17 · OPTIONAL

Take it or Leave it Demo

— solves
This challenge is optional, it will not count towards dojo completion.

Stack Pivoting Challenges

CHALLENGE 18

Pivotal Prelude (Easy)

— solves

Perform a stack pivot to gain control flow!

CHALLENGE 19

Pivotal Prelude (Hard)

— solves

Perform a stack pivot to gain control flow!

CHALLENGE 20

Pivotal Pointer (Easy)

— solves

Perform a partial overwrite to call the win function.

CHALLENGE 21

Pivotal Pointer (Hard)

— solves

Perform a partial overwrite to call the win function.

CHALLENGE 22

Pivotal Payload (Easy)

— solves

Apply stack pivoting to call the win function.

CHALLENGE 23

Pivotal Payload (Hard)

— solves

Apply stack pivoting to call the win function.

CHALLENGE 24

Pivotal Pursuit (Easy)

— solves

Creatively apply stack pivoting to call the win function.

CHALLENGE 25

Pivotal Pursuit (Hard)

— solves

Creatively apply stack pivoting to call the win function.

Exploitation

CHALLENGE 26

Guarded Gadgets (Easy)

— solves

Perform ROP when the function has a canary!

CHALLENGE 27

Guarded Gadgets (Hard)

— solves

Perform ROP when the function has a canary!

CHALLENGE 28

ROP Roulette (Easy)

— solves

Perform ROP against a network forkserver!

CHALLENGE 29

ROP Roulette (Hard)

— solves

Perform ROP against a network forkserver!

CHALLENGE 30

Libc Lottery (Easy)

— solves

Perform ROP when the stack frame returns to libc!

CHALLENGE 31

Libc Lottery (Hard)

— solves

Perform ROP when the stack frame returns to libc!