Level Goal
The password for the next level is stored in the file data.txt and is the only line of text that occurs only onceCommands you may need to solve this level
grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxdSolution:
- [Comment] Using SSH to connect the server
- sp@simple-plan:~|=> ssh bandit8@bandit.labs.overthewire.org
...
bandit8@bandit.labs.overthewire.org's password: cvX2JJa4CFALtqS87jk27qwqGhBM9plV - [Comment] Using ls command to list directory contents
- bandit8@melinda:~$ ls
data.txt - [Comment] Using sort command to sort lines of data.txt first
- [Comment] Then, using uniq command with --count option to count number of duplicate lines
- [Comment] At last, using grep command to search for the only one line
- [Comment] Don't forget to pipe the commands together
- bandit8@melinda:~$ sort data.txt | uniq --count | grep "1 "
1 UsvVyFSfZZWbi6wgC7dAFyFuR6jQQUhR - [Comment] Using exit command to disconnect connection to server
- bandit8@melinda:~$ exit
logout
Connection to bandit.labs.overthewire.org closed. - [Comment] It's done! Saving the password for next level.
sort data.txt | uniq -u
ReplyDelete@ Scooge Santa: If uniq -u searches for the unique line in the whole file, then why do we need to sort the data.txt file?
ReplyDelete@ Scooge Santa: If uniq -u searches for the unique line in the whole file, then why do we need to sort the data.txt file?
ReplyDelete-u doesnt searches for the unique line, it put all duplicated lines in one example:
DeleteAaaaaa
Bbbbbb
Aaaaaa
Aaaaaa
Uniq -u
Aaaaaa
Bbbbbb
If you use uniq -u -c
3 Aaaaaaa
1 Bbbbbbb