Drifter Level 3
Drifter Level 3 — a remote heap corruption bug in a program linked against an old malloc implementation, with source supplied.
Table of Contents
Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.
Level 3 is a remote heap corruption issue. Source code can be found in /drifter/drifter3_src/. It is linked against an ancient malloc implementation so it should be easily exploitable :)
Once upon a free()… - suitable reading material, amongst others.
Study guide
Where it fits: Drifter level 3 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. The source is in /drifter/drifter3_src/.
What this level teaches
Classic heap-metadata attacks against an allocator without modern checks.
Key ideas
- Ancient malloc. The program uses an old allocator that does not validate its internal metadata, which the page says should make it easily exploitable.
- Unlink-style attacks. Corrupting a chunk’s links so that a later free writes where you choose.
- Remote. You deliver the corruption over the network, so build a reliable client.
- Reading. “Once upon a free()…” is the suggested paper.
How to approach it
- Read the allocator behaviour and the program’s use of it.
- Find the overflow and what chunk it reaches.
- Turn the corrupted metadata into a controlled write, then into code execution.
Why it matters
Modern allocators add many checks because of exactly this class of attack.