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

Bandit Level 5

Bandit Level 5 — identify the one human-readable file among many using the file command.

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

Level Goal

The password for the next level is stored in the only human-readable file in the inhere directory. Tip: if your terminal is messed up, try the “reset” command.

Commands you may need to solve this level

ls , cd , cat , file , du , find

Study guide

Level map: logged in as bandit4, find the password for bandit5.

What this level teaches

A filename or extension tells you nothing reliable about contents. The file command inspects the data itself.

Key ideas

  • Magic numbers. Many file formats begin with signature bytes. file reads them and reports a type such as ASCII text, data or executable.
  • Why printing binary files hurts. Sending arbitrary bytes to a terminal can send control codes that garble your display. If that happens, the reset command restores it.
  • Filenames can still be awkward. The files in this directory begin with a character that already caused trouble in an earlier level.

How to approach it

  1. List the directory, then run file on every candidate at once using a wildcard. Remember how Level 2 told you to write the paths.
  2. Only cat the file that file identifies as text.

Why it matters

Forensics, malware triage and upload filters all rely on content-based identification rather than trusting names, a theme that returns strongly in the web-security game Natas.