Bandit Level 2 Solution

Bandit level 2 teaches you about how to deal with names with spaces in bash in case you have a file that includes space and how to skip them with them.

Let’s start by logging into bandit level 2 machine

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

with the password that we got from the previous level

CV1DtqXWVFXTvM2F0k09SHz0YwRINYA9

Let’s start By Listing the files

now you can read files with spaces by putting “\” before each space, so the bash will know that this is a space and not a new argument passed to the command.

cat spaces\ in\ this\ filename

or, you can include the file name within double quotes “”

cat "spaces in this filename"

and this is how you’ll get the password for the next level that you can access it from here.

UmHadQclWmgdLOKQ3YNgjWxGoRMb5luK