OverTheWire Bandit Level 8 Walkthrough

Today we're doing a walkthrough of level 8 of the Bandit CTF wargame hosted at OverTheWire.org.  First, let's take a look at the level's objectives:

https://overthewire.org/wargames/bandit/bandit9.html


The Flag for the level is located in the data.txt file as the only string that occurs exactly once in the file.

Next, let's SSH in the game server to start the level.  Remember to use the Flag from the previous level as the SSH password.

ssh bandit8@bandit.labs.overthewire.org -p 2220


And now to locate the data.txt file.

pwd
ls -a


To find the Flag string, we'll use the sort and uniq commands with a pipe | to extract the string we want.  The sort command will put all the identical strings in the file together, then the uniq command with the -u switch will output only strings that occur exactly once in the file.  The reason we use the sort command before the uniq command is that the uniq command will not work properly unless the duplicate strings in the file are sorted first.

sort data.txt | uniq -u


Summary

Bandit8 requires us to sort through strings in a file to find the Flag string, which is the only string in the file that is not duplicated within the file.

Finish


Comments

Popular posts from this blog

TryHackMe - Windows PrivEsc - Walkthrough

TryHackMe - Reversing Elf - Walkthrough

TryHackMe - XSS - Walkthrough