Bandit Level 8 -> 9

8 -> 9

The difference is not so visible

Bandit Level 9:

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 we may need to solve this level:

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

Helpful Reading Material


First, let’s ssh to the level 9 server:

What’s so unique about the texts anyways

So now we’re in the level 9 server, and apart from some details about the server and NDA details, there is just a shell prompt.

We’re now looking for a unique, un-duplicated text in a list of texts inside the file, oddly enough the uniqe command seems interesting, let’s check the manual for it:

Judging by the man page, we can use this command for getting duplicated lines or the opposite, which is the unique line, we have various options for this, though what we need might be the unique option.

Okay so how do we use the command, on the man page it does specify that it matches lines from the standard input, so we need to feed the command from the standard input

In this case, we pipe the output of the file to the command

Well upon using these combinations of commands, we didn’t get our unique line, why would that be?

Wait wait wait, it does say adjacent matching lines, so we need to sort each line so the uniq command can process and check each line with the next line. For that, we have the sort command:

Hurray we found it, hey finders keepers.

That’s it and see you on the next one.

Thank you, Enjoy.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.