Bandit level 2
Level Goal:
The password for the next level is stored in a file called spaces in this filename located in the home directory.
Again our task is pretty simple, we need to cat out the content of a single file found in the home directory. But now the challenge is that the file has spaces in the filename.
Things to consider:
What problems does the spaces in the filename produce?
How can we circumvent the problem?
Solution - Spoiler Alert!
Since trying to use cat spaces in this filename
will try to concatinate the files named: spaces, in, this, filename
To circumvent this problem we can use at least two different commands cat "spaces in this filename"
or cat spaces\ in\ this\ filename
The first of those two encapsulates everything between the double quotes as one single string. While the second command uses backslashes to escape out the space. And bash will not se it as a separator between files anymore. But as a space that belongs in the string
Comments ()