BB

technology and craziness.

BB

technology and craziness.

OverTheWire - Bandit - Level 8 → Level 9

Warning: This post contains a solution!
Only continue if:
1.) you want to see a possible alternative solution or
2.) you are stuck and need a hint!

Connect to the server using the following credentials:

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

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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
bandit8@bandit:~$ man uniq
UNIQ(1)                                                               User Commands                                                               UNIQ(1)

NAME
       uniq - report or omit repeated lines

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

DESCRIPTION
       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:

1
2
bandit8@bandit:~$ sort data.txt | uniq -u
UsvVxxxxxxxxxxxxxxxxxxxxxxxxxxxx