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

Bandit Level 4

Bandit Level 4 — find a hidden dotfile inside the inhere directory with ls -a.

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.