Skip to content

Bandit Level 4

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 a hidden file in the inhere directory.

Commands you may need to solve this level

ls , cd , cat , file , du , find

Study guide

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

What this level teaches

How Unix hides files, and why that is a convention rather than a security feature.

Key ideas

  • Dotfiles. Any file or directory whose name starts with . is skipped by a plain ls. They typically hold per-user configuration such as .bashrc or .ssh/.
  • ls -a shows "all" entries, including . (this directory) and .. (the parent).
  • Hidden is not secret. Anyone can list the files; the dot only reduces clutter.

How to approach it

  1. Enter the inhere directory. A plain ls appears empty, which is the clue.
  2. Use the option that includes hidden entries, then print the file that is not . or ...
  3. Combine options such as -la to also see permissions and sizes.

Why it matters

Malware and attackers often hide persistence in dotfiles, and incident responders list them first. You will also meet dotfiles daily when configuring tools.