OverTheWire.org Walkthrough: Bandit

~ LEVEL 1→2 ~

Level Description

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

Commands recommended for this level are the same as the previous level: ls, cd, cat, file, du, find.


Research Before Solving

Just as before, OverTheWire provides links to reference material that may be useful in solving the current level. Of the two links, we will focus on the first one which is a simple Google search. When clicking the hyperlink and reading through the information, the third result (may be different for you) from unix.stackexchange.com gives some insight into reading dashed filenames. The syntax appears to be cat ./-filename where filename is replaced by the desired file's actual name.


Solution Walkthrough

To start this level, let's connect to the OverTheWire server via SSH. In this instance we will be bandit1 making the sytax into the following:

SSH command to connect as bandit 1

You should be prompted for bandit1's password next. Copy and then right click to paste the password obtained from the previous level into the prompt. As a warning, you may be required to enter the password more than one time due to failure. Continue to enter the password until it is successful. Once logged in, you should notice you are now the user bandit1.

Following suit with the previous level, let's start with an ls command. Your output should look like the following:

LS command and resulting output

Tying this in with what we learned about reading files that start with a dash, lets run the following command: cat ./-

Password output from using cat ./-

Voilà! The password is shown to us: CV1DtqXWVFXTvM2F0k09SHz0YwRINYA9 Make sure to save it and then exit out of the terminal as we did last time. You're ready to move to the next level.