OverTheWire Bandit Guide

here's how to solve the bandit level 2 → 3

Back to the Bandit Guides

Previous Level Guide: Bandit Level 1 → 2


Access

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

Password: gTSrLU45901yl2RcmpaySeLGyyrf2Gfs

Info

Description: The password for the next level is stored in a file called spaces in this filename located in the home directory
Commands: ls, cd, cat, file, du, find

Theory

To get the password, the instructions say that the file name has spaces in it. I researched a bit online and found a couple of methods to do this space filename stuff. So one of the options to get this password is to use backslashes before spaces, and the other to just put the entire filename inside double quotes.

Solution

Now let's just check for the file:

~$ ls
spaces in this filename

And it is literally spaces in this filename. So, to just check that the two methods work we can do something like this:

~$ cat spaces\ in\ this\ filename
AOOmfkeQNfPIUaKmy2dCg9LrRfh1dK7Ud

~$ cat "spaces in this filename"
AOOmfkeQNfPIUaKmy2dCg9LrRfh1dK7Ud

And they both worked! Now that we've got the password, just use exit to logout and go to the next level.

https://overthewire.org/wargames/bandit/bandit3.html
Next Level Guide: Bandit Level 3 → Level 4