Bandit level 1

Level Goal:
The password for the next level is stored in a file called "-" located in the home directory

At first this task seems just as easy as the previous one. but when we run cat - it appears like the terminal hangs, most likely waiting for some input. So we need to find another way to read the content of the file.

Things we can try: copy or move the file, search it with less, or edit it with vim.

Using ls -la we can list files and permissions. What permissions do we have?

Using less and vim, what is the output?

Solution - Spoiler Alert!

Using ls -la we can see that we only have reading permissions. So copy and move the file is out of the window.

Using less - we open less but nothing happens at all, and I need to close the terminal and reconnect.

When we try to read it with vim - we get our first hint. Here we get the message Vim: Reading from stdin ... This tells us that using a single dash - as an argument most likely refers to the stdin.

with that knowledge we can now try and cat the file with either e full path, or a proper relative path instead of just filename.

we can now cat ./- and now we can read the output!

overview
Bandit level 0
Bandit level 2