As we advance in the Bandit Challenge, Level 2 ↗️ presents us with a peculiar file name. Our objective is to locate and extract the password stored in a file with a dashed filename within the home directory.
Level 2 introduces us to a file with a special name containing a hyphen
Our task is to identify and access this file, which holds the password for the
We’ll leverage commands such as “ls,” “cd,” and “cat” to navigate the file system, examine the contents of the file, and uncover the password.
Log in to Level 1 using SSH with the following command:
Enter the password you obtained from the previous level.
After logging in, execute the following command to view the files in the home directory:
This command reveals hidden files, denoted by filenames beginning with a dot.
Among the files, you will find the one with the dashed filename. To view its contents, use the
"./-" specifies the file with the dashed filename.
The password for Level 2 will be displayed in the output. Make a note of it for the next level.
Level 2 enhanced our file navigation skills and introduced us to special characters in filenames. We learned to use the “ls” command with options to reveal hidden files and successfully accessed a file with a dashed filename.
These skills are valuable in real-world scenarios where file naming conventions might deviate from the norm.
- When encountering special characters in filenames, use
"./"before the filename to ensure proper interpretation.
Congratulations on completing Level 2 of the Bandit Challenge! We skillfully maneuvered through a file system containing a file with a unique dashed filename.
By using essential commands and understanding the impact of special characters, we successfully extracted the password. We’re one step closer to mastering cybersecurity!
Stay tuned for the next blog post, where we’ll explore Level 3 and face new challenges in our quest for cybersecurity expertise.