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 25, 15:18

Page Location

Page Info

Layout default
Collection wargames
Path _wargames/behemoth/behemoth1.md
URL /wargames/behemoth/behemoth1/
Date 2026-04-07

Behemoth Level 1

Behemoth Level 1 — a classic stack buffer overflow in a binary without source, where you inject shellcode and redirect execution to it.

Table of Contents

Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.

There is no information for this level, intentionally.

Study guide

Level map: logged in as behemoth1, find the password for behemoth2.

What this level teaches

The Narnia-style stack overflow, but starting from a binary alone.

Key ideas

  • Unsafe input functions. Functions that read without a length limit, such as gets, make overflows trivial. Disassembly or ltrace will show which one is used.
  • Finding the offset. Send a cyclic pattern in gdb and read which part lands in the saved return address.
  • Shellcode and its address. Place shellcode in the buffer or environment, and aim the return address at it. Remember gdb changes the stack slightly compared with a normal run.
  • Keep the shell alive. Make sure your input does not close standard input before the shell can use it.

How to approach it

  1. Confirm the crash with a long input.
  2. Find the offset and the buffer’s address.
  3. Build and test the payload, adjusting for the real stack layout.

Why it matters

It consolidates the Narnia skills and confirms you can work without source.