The password for the next level is stored in the file data.txt and is the only line of text that occurs only once
grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd
bandit8@bandit:~$ ls
data.txt
bandit8@bandit:~$ cat data.txt
riAxnw3RnsFuQiOD8BlZbR6TlERU9866
pJyx6KXXkALfk2n5VSyWS4fqKvnyuN8G
tAw9D85F6PkUdTdlCwmRWYlQNPbkcVox
WWKtMcgokvQfZKjkt2yfJDtMMclL3cMn
fYJtDkXtfgl2A0r3iOlMNrmmCePl568B
.....
There is a file where we need to find a word that appears only once, but the content is too long to search manually. This time, we can't use the `grep` command because we don't know a specific pattern to match. However, we have a clue: the text appears only one time.
bandit8@bandit:~$ uniq -c data.txt
1 riAxnw3RnsFuQiOD8BlZbR6TlERU9866
1 pJyx6KXXkALfk2n5VSyWS4fqKvnyuN8G
1 tAw9D85F6PkUdTdlCwmRWYlQNPbkcVox
1 WWKtMcgokvQfZKjkt2yfJDtMMclL3cMn
1 fYJtDkXtfgl2A0r3iOlMNrmmCePl568B
.......
The `uniq` command is suitable for this challenge. By using the `-c` option, we can see how many times each line occurs. However, since `uniq` only filters adjacent matching lines, we need to sort the file first to make it effective.
bandit8@bandit:~$ sort data.txt | uniq -c
10 0KCctkqCfY7BIOWqolXsHDaboXVTKZ49
10 1SKCEfQ151hWOx9JkeIAmOQdXiC813h1
10 3hHLofjM7m3sdyiKJF5QsMqvEIfFh5b1
10 3hW8tLnDV8acjhTQi44CKXEzHsJb3sqz
10 3nUXvAjKo7yu6fYykYu7nGGKDMuNMWZf
10 42qjuz5hdLlItNwdJYsDRpkbbvoEYiWK
1 4CKMh1JI91bUIZZPXDqGanal4xvAg0JM
10 5g2sV4OokwqDv29Pfo6C7twjKcOk4WQV
10 5YlL2xxyEUqV6tF0P6NoHt8LOY2EGEcO
10 6lMDNhQjlOoCOZ5F8ULK2g0uT0rCdnoQ
......
bandit8@bandit:~$ sort data.txt | uniq -u
4CKMh1JI91bUIZZPXDqGanal4xvAg0JM
We can utilize the `uniq` command in two ways. First, by using the `-c` option to check how many times each line occurs. Second, by using the `-u` option to print only the unique lines. This will help us find the password!
Next Level : Level 9 -> 10
Bandit Level 10 -> Level 11 (0) | 2024.09.11 |
---|---|
Bandit Level 9 -> Level 10 (1) | 2024.09.09 |
Bandit Level 7 -> Level 8 (0) | 2024.09.07 |
Bandit Level 6 -> Level 7 (0) | 2024.09.06 |
Bandit Level 5 -> Level 6 (0) | 2024.08.16 |