OverTheWire: Bandit Level 9

Akash Ambashankar
1 min readNov 29, 2020

In the last post, we gained access to bandit8. Now, let’s find the password for bandit9.

Level 9

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 to solve this level

grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd

If we try reading the contents of data.txt using cat, we get a lot of lines of random characters.

We’re going to figure out which of these lines occurs only once.

There is a command called uniq which can identify unique lines in a given file. It has a flag, -u, which returns unique lines alone.

But the problem with uniq is that it doesn’t detect repeated lines unless they’re adjacent. To overcome this, uniq needs to be used along with sort, which sorts the contents of a given file.

So once we sort the contents of the file, the repeated lines will be adjacent, so that uniq -u can detect and ignore those lines.

bandit8@bandit:~$ sort data.txt | uniq -u
UsvVyFSfZZWbi6wgC7dAFyFuR6jQQUhR

And we have the password for bandit9, UsvVyFSfZZWbi6wgC7dAFyFuR6jQQUhR.

Happy Hacking!

--

--