Challenges › Binary Exploitation

Build a Return Chain

medium · 50 XP · flag · free · solves: 0

A small program called build-a-return-chain prints two addresses, then reads one line into a fixed-size buffer. checksec shows NX enabled, stack canary found, PIE enabled, and partial RELRO.

The two printed lines are the stack canary's current value and the real runtime address of puts, both intended leaks for this exercise. Use the canary to survive the overflow, use the puts address to compute the loaded library's base, then build a ret2libc chain that calls system("/bin/sh") or runs a command of your choice once inside the shell.

Submit the flag printed by cat flag.txt once you have a working shell.

Tags: learn

Try next