OverTheWire – Bandit Challenge 2 – Level 2 -> Level 3

Level 2 → 3: The Dashboard Trap (Command Arguments vs. Files)

Mission Briefing: You’ve logged in as bandit1. The password for the next level is stored in a file located in your home directory. However, the creators of this wargame are trying to teach you a lesson about how computers read text. They have named the file - (a single dash).

The Anatomy of the Problem: Go ahead, try to read it using what you learned in the last level. Type cat - and hit enter.

Notice what happens? The terminal just sits there, blinking at you. It froze. Why?

In Linux, a standalone dash - is a reserved symbol. It tells the command line to read from “Standard Input” (meaning it is waiting for you to type something on your keyboard). You asked the computer to “read the file named dash,” but the computer heard “wait for me to type.”

You have to trick the terminal into realizing that this dash is a filename, not a system instruction.

The Solution: Hit Ctrl + C on your keyboard to cancel the frozen command. Now, type this:

Bash

cat ./-

🕷️ DigiSpidey’s Breakdown: This is a classic SysAdmin trick. By prefixing the file with ./, we are using a Relative Path.

  • . means “The current directory I am standing in.”
  • / is just the separator between folders and files.

By typing ./-, you are explicitly telling Linux: “Look inside the current directory, and open the literal file named dash.” Because you provided a path, Linux stops treating the dash as a special symbol and treats it as a standard file.

Copy the password it spits out, exit, and get ready for Level 3.