Introduction
As we continue our ascent in the Bandit Challenge, Level 18 ↗️ presents us with a unique challenge. We’re faced with two files, and our task is to identify the password that has been changed between them.
Challenge Overview
Level 18 challenges us to compare two files, passwords.old and passwords.new, and identify the password that has been changed between them. Our goal is to locate the single line within passwords.new that differs from the corresponding line in passwords.old.
By using commands like cat
, grep
, and diff
, we’ll successfully uncover the password and advance to the next level.
Approach and Strategy
Remember in previous level we did not get a password but instead got a private SSH key. We will use that key to login to this level.
Login to SSH by providing the private key using the -i
flag.
Now, we will use the diff
command to compare the contents of the two files and identify the changed line
This command will display the differences between the two files.
The --suppress-common-lines
flag will suppress the common lines between the two files, and the --side-by-side
flag will display the output in a side-by-side format.
Since we want to pick the password from the new file, we will take the password from the left side of the output. Take note of it for the next level.
Notes
- The
diff
↗️ command is used to compare the contents of two files. - Pay close attention to the output of the diff command to identify changed lines.
Conclusion
Congratulations on successfully completing Level 18 of the Bandit Challenge! By comparing the contents of two files and identifying the changed line, we uncovered the password for the next level.
Stay tuned for the next blog post, where we’ll take on Level 19 and continue our journey to become proficient cybersecurity practitioners.