BanditOverTheWire

Bandit2

Website URL: http://overthewire.org/wargames/bandit/bandit2.html

Let’s resume from Bandit1, logging into the server with the bandit1 credentials we obtained in the previous level.

Fig 1.

Reading through the OverTheWire webpage for bandit2, we see:

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

Let’s run a ls command and see it’s output:

ls

Notice the file named ‘-‘. Let’s run a cat command as we did earlier:

cat -

It seems this command is not working. Let’s find a workaround. We need to read the contents of the file, but we can’t use cat. Let’s try vim instead.

But ‘-‘ being a special character. we cannot use it directly. Let’s use directory listing mode in vim.

vim .

Fig 2.

Now, let’s select the file and press Enter.

Fig 3

We get the desired password for bandit2.

Leave a Reply

Your email address will not be published. Required fields are marked *