Bandit 2 → 3
Goal: read the password from a file whose name contains spaces.
Approach
Section titled “Approach”bandit2@bandit:~$ ls--spaces in this filename--bandit2@bandit:~$ cat "./--spaces in this filename--"The password you are looking for is: <password>Password
MNk8KNH3Usiio41PRUEoDFPqfxLPlSmxWhy it works
Section titled “Why it works”The shell splits a command line into words on whitespace, meaning an unquoted name with spaces arrives as several separate arguments. Quoting the whole path (or escaping each space, or tab completing) passes it as one. The leading dashes also need the ./ prefix so the name is not read as an option.