MayADevBe Blog

A Blog about Computer Science

OverTheWire Bandit Level 1 -> 2 - Walkthrough

Previous Level: Level 1


Login

SSH: ssh bandit1@bandit.labs.overthewire.org -p 2220

Password: boJ9jbbUNNfktd78OOpsqOltutMc3MY1

Task

Get the password from the file called ‘-’.

A little bit of Theory

‘-’ is a special symbol in Linux. So it is not recommended to start a file name with this symbol. ‘-’ is the standard option character. We have already seen it for adding so-called flags for specific options to a command (Like the -p flag for choosing a port for the ssh command.). standard option. Because of this, files with this symbol as the first character cannot just be referenced as other files.

Solution

First, we make sure the file is in the folder by printing all the files.

1
2
bandit1@bandit:~$ ls
-

Using the command cat - does not return anything. So instead of writing just - we add the path and write ./- and the command works as it should:

1
2
bandit1@bandit:~$ cat ./-
CV1DtqXWVFXTvM2F0k09SHz0YwRINYA9

So we got the next password.


https://overthewire.org/wargames/bandit/bandit2.html


Next Level: Level 3


Share on: