Bandit 3 ( level 2->3 )

Level Goal

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

Commands you may need to solve this level

ls , cd , cat , file , du , find

Helpful Reading Material

Solving

ssh into bandit2:

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

In this level we'll also be playing with a tricky file name. In this level, we have spaces (" ") in file name, as you'll see in the img1.

img1

Of course we can not cat it ordinary, the spaces in a file name makes the shell think that they're a different files as I'll show you in the img2.

img2

To solve this scenario, there are many ways. In this blog I'll be showing 2 ways of the solutions

1.) Using ""

You can use "" to cover the whole file name, like:

cat "spaces in this filename"
img3

or,

2.) Using TAB

Anytime you are writing the command, you can always press the tab button to let the shell helps you finish the command. In this case, I also used tab and it works !:

img4
img5

In img4, I wrote the command to the 'spaces' and then I stop and pressed TAB, giving me the result in img5. It works fine.

Anyway, as you can see, we captured our flag.

MNk8KNH3Usiio41PRUEoDFPqfxLPlSmx

Last updated