overthewire-writeups

Bandit08 -> 09: The Only Unique One

Challenge

Level Description

The password for the next level is stored in the file data.txt and is the only line of text that occurs only once. The file is full of repeated lines, so we need to filter them out!

The Process

Logging in, I found another data.txt file. This time, the challenge wasn’t finding a keyword, but finding a unique needle in a sea of duplicates.

I used two powerful commands together: sort and uniq. Here is the catch: the uniq command only works correctly on text that is already sorted, because it compares a line to the one immediately following it.

Here is the pipeline I used:

$ sort data.txt | uniq -u

Here is why this worked:

The terminal blinked and spit out exactly one line. That was our password!

Password For the Next Level

[SPOILER]

What I Learned

Helpful Reading Material