tutorial · bandit

Bandit Level 1

Read a file literally named '-' (dash) and get the Level 2 password.
banditfilesstdin
Optional narration
Marks this level complete in your browser.

Goal

The password for the next level is stored in a file called -.

That’s not a typo. It’s a single dash.

Why this is tricky

Many CLI tools treat - as a special value meaning:

  • stdin (read input from the terminal)
  • or stdout (write output to the terminal)

So you need to reference the file carefully.

Steps

  1. SSH in (same host/port as usual):
ssh bandit1@bandit.labs.overthewire.org -p 2220
  1. List files:
ls
  1. Read the file named - using one of these safe patterns:

Option A (most direct)

cat ./-

Option B (explicit path)

cat /home/bandit1/-

That output is the password for Level 2.

Notes

  • If you do cat - you’ll be reading from stdin (it will “hang” waiting for input). Press Ctrl+C to cancel.