OverTheWire Level 8 -> Level 9解题过程
级别:Bandit Level 8 → Level 9
目标: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 once
密码保存在data.txt文件中,并那一行(包含密码的那一行)只出现了一次
允许命令:Commands you may need to solve this level
grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd
解题过程:
此题需要用到sort命令,sort 是 Linux 的排序命令,而且可以依据不同的数据类型来进行排序。sort 将文件的每一行作为一个单位,相互比较。比较原则是从首字符向后,依次按 ASCII 码值进行比较,最后将它们按升序输出。然后利用uniq进行统计每行出现的次数,次数为1的即为密码
bandit8@bandit:~$ sort data.txt | uniq -c | sort -r | head -n 5 1 UsvVyFSfZZWbi6wgC7dAFyFuR6jQQUhR 10 zdd2ctVveROGeiS2WE3TeLZMeL5jL7iM 10 Z9OC6DQpppreChPhwRJJV9YYTtrxNVcO 10 ySvsTwlMgnUF0n86Fgmn2TNjkSOlrV72 10 yo0HbSe2GM0jJNhRQLxwoPp7ayYEmRKY bandit8@bandit:~$
STRIVE FOR PROGRESS,NOT FOR PERFECTION