Level1

Level Goal

The password for the next level is stored in a file called - located in the home directory

Solution

root@0xCAB: /writeups/overthewire/bandit/level1/

$ ls
-

$ cat ./-
CV1DtqXWVFXTvM2F0k09SHz0YwRINYA9

$

The - character can have special meanings in bash depending on the context in which it is used. If we tried to do cat - or less -, it would cause stdin to be redirected to stdout. So to read the contents of that file, we can use the absolute (cat /home/bandit1/- or cat ~/- for short) or relative (cat ./-) path. See this section on the Linux documentation project’s site.