OverTheWire Bandit Level 8 → 9 Walkthrough
Finding the only unique line in a file using sort and uniq -u
Level goal: The password for the next level is stored in the file data.txt and is the only line of text that occurs only once
Commands you may need: grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd
Helpful reading:
-
The unix commandline: pipes and redirects(Site no longer active)
Write-up
I really didn’t use a proper method to solve this one. I used sort data.txt to get all data in a sorted manner so that all the repeated lines are together. Then I found out the odd one out through visual inspection. You can see below how easy it is to spot.
Hence I got the password.
Edit: Found a better method for this. The
uniqcommand! When the data is sorted the-uflag can be used to print only the unique lines.
1
sort data.txt | uniq -u
Level 9 password:
UsvVyFSfZZWbi6wgC7dAFyFuR6jQQUhR

