Bandit Level 8 → Level 9
Introduction
Bandit9 is the tenth level of the OverTheWire Bandit wargame. In this level, we are given a file called data.txt
and we have to find the line that occurs only once in the file.
Steps
- Open your terminal application.
- Enter the following command to ssh into the remote server:
ssh bandit8@bandit.labs.overthewire.org -p 2220
- Enter the password for Bandit8:
z7WtoNQU2XfjmMtWA8u5rN4vzqu4v99S
- Now, you are logged in as Bandit8 and can start solving the level.
- Use the
cat
command to read the contents of thedata.txt
file:
cat data.txt
- We need to find the line that occurs only once in the file. To do this, we can use the
sort
command to sort the lines of the file, and then theuniq -u
command to show only the lines that occur once:
cat data.txt | sort | uniq -u
Congratulations! You have successfully solved Bandit9 and obtained the password for the next level EN632PlfYiZbn3PhVK3XOGSlNInNE00t
.
Conclusion
In this level, we learned how to use the sort
and uniq
commands to find a unique line in a file. These are powerful commands that can be used to analyze and manipulate large amounts of data.