OverTheWire - Bandit - Level 8 → Level 9

Connect to the server using the following credentials:

Server: bandit.labs.overthewire.org
Port: 2220
Username: bandit8
Password: cvX2JJa4CFALtqS87jk27qwqGhBM9plV

Level Goal is:

The password for the next level is stored in the file data.txt and is the only line of text that occurs only once

With this information in mind, we can search for a unique line in the file. We can use the uniq command to do that.

bandit8@bandit:~$ man uniq
UNIQ(1)                                                               User Commands                                                               UNIQ(1)

       uniq - report or omit repeated lines

       uniq [OPTION]... [INPUT [OUTPUT]]

       Filter adjacent matching lines from INPUT (or standard input), writing to OUTPUT (or standard output).

       With no options, matching lines are merged to the first occurrence.


       Note:  'uniq'  does  not  detect  repeated lines unless they are adjacent.  You may want to sort the input first, or use 'sort -u' without 'uniq'.
       Also, comparisons honor the rules specified by 'LC_COLLATE'.


As described under 'Note:', we first have to sort the list.
So, just combine sort and uniq:

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