Akash Trehan
Write-ups

OverTheWire Bandit Level 8 → 9 Walkthrough

Finding the only unique line in a file using sort and uniq -u

By Akash Trehan · · 1 min read · Wargame
OverTheWire Bandit Level 8 wargame title banner
OverTheWire Bandit Level 8 → 9 Walkthrough

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:

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.

sort_output

Hence I got the password.

Edit: Found a better method for this. The uniq command! When the data is sorted the -u flag can be used to print only the unique lines.

1
sort data.txt | uniq -u

Level 9 password: UsvVyFSfZZWbi6wgC7dAFyFuR6jQQUhR