Drifter Level 2
Drifter Level 2 — a simple stack overflow whose side effects get in the way of debugging and of launching a program directly with execve.
Table of Contents
Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.
Simple stack overflow, but with a side effect that affects debugging, and executing problems. Keep in mind that a straight execve() will not work, due to kernel issuing a breakpoint.
Study guide
Where it fits: Drifter level 2 of 0–15, in the memory corruption stage of the game. The page does not say which account you start as, so check with id after connecting.
What this level teaches
How an apparently simple exploit can be complicated by the environment.
Key ideas
- Simple bug. The page describes a simple stack overflow.
- Side effect on debugging. Something about how the program runs affects how you can debug it, so work out an alternative debugging method.
- The execve warning. A straight
execve()call will not work because the kernel issues a breakpoint; your payload must start a shell by another route. - Think about the platform. Behaviour that differs from earlier levels is the clue.
How to approach it
- Reproduce the crash and find the offset.
- Identify exactly what stops your usual payload from working.
- Adjust the payload until the program does what you want.
Why it matters
Real targets have quirks that break textbook exploits, and diagnosing them is half the job.