OverTheWire.org Walkthrough: Bandit

~ LEVEL 2→3 ~

Level Description

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

Commands that we may need to solve the level are: ls, cd, cat, file, du, find.


Research Before Solving

The reading material provided for this level is another Google search. This time we must find relevant results for how to open files with spaces inside of their name.

Upon clicking the hyperlink, the third search result looks promising. After redirecting to superuser.com, the top answer provided says to put quotations around the file name.


Solution Walkthrough

Let's log in to the OverTheWire server again, this time using bandit2 as the username. Following that, copy and paste in the password we retrieved from the previous level.

SSH command to connect as bandit 2

Since we have been put into the home directory by default each time, we will assume the same will happen this time. Go ahead and use the ls command to see what files are present.

LS command with output of a file named spaces in this filename

Next, use the syntax suggested from the superuser forum: cat "spaces in this filename"

Password output from using cat spaces in this filename

Save the password, UmHadQclWmgdLOKQ3YNgjWxGoRMb5luK, in your designated app of choice and exit the SSH session. It's time to move on to the next level!