Skip to main content

Settings

Color Mode

Theme Skin

Background

Appearance preferences are saved in this browser only.

Environment

Current Environment Production

Built with JEKYLL_ENV=production. Changes require deployment.

Quick Links

Theme & Build

Jekyll v3.10.0
Last BuildNov 24, 17:25

Page Location

Page Info

Layout default
Collection wargames
Path _wargames/drifter/drifter2.md
URL /wargames/drifter/drifter2/
Date 2026-04-07

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

  1. Reproduce the crash and find the offset.
  2. Identify exactly what stops your usual payload from working.
  3. 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.