Skip to content

Leviathan Level 5

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.