Bandit 2 ( level 1->2 )
Last updated
Last updated
The password for the next level is stored in a file called - located in the home directory
ls , cd , cat , file , du , find
ssh into bandit1:
In this level we'll be dealing with a tricky file name.
As you can see in the img1, we have a file named - (dash). Which we can't just cat it ordinary.
You can see in img2 that the cat
command is not reading texts inside the -
file.
The reason is in the command cat -
: the -
tells cat
to read from stdin rather than a file.
Quick note: stdin refers to standard input. In Unix-like operating systems, it's one of the three standard data streams used for input and output in programs, along with stdout (standard output) and stderr (standard error).
To solve our scenario we can use './' before a file name to directly reference to a file like:
There we go, we captured our flag.