Bandit Level 1 Solution

Bandit level 1 teaches you about how to deal with special characters in bash in case you have a file that starts with them, for a list of special characters , you can check it from here.

Let’s start by logging into bandit level 1 machine

ssh -p 2220

with the password that we got from the previous level


let’s list all the files that are in our home directory

ls -la

You should get the following

home directory

now if we try to open the file with

cat - 

you will get a blank input with repeating the input that you type because – character is a convention to refer stdin or stdout.

in order to open a file that starts with “-” or it’s called “-“, you have two ways, the first one is to specify the full path like

cat ./-

or by using redirection like

cat < -
read “-” file

and that’s how we get the password for our challenge


you can check the next level from here