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/leviathan/leviathan5.md
URL /wargames/leviathan/leviathan5/
Date 2026-04-07

Leviathan Level 5

Leviathan Level 5 — a setuid program reads a file from a fixed path; learn how symbolic links redirect 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 leviathan5, find the password for leviathan6.

What this level teaches

How symbolic links (“symlinks”) can trick a privileged program that trusts a predictable path.

Key ideas

  • Symlinks. A symlink is a small file that points at another path; ln -s TARGET LINKNAME creates one.
  • Following links. When a privileged program opens a file, the operating system follows a symlink transparently, using the program’s privileges, not yours.
  • Predictable paths. Programs that use fixed names in shared directories like /tmp are open to this.
  • Trace to learn. ltrace reveals the path the program opens.

How to approach it

  1. Run the program and under ltrace to find which file it tries to open.
  2. Think about what that name could point at instead.

Why it matters

Insecure use of temporary files is a classic source of local privilege escalation, which is why mktemp and unpredictable names exist.