OverTheWire Bandit Level 6 to Level 10
OverTheWire Bandit Level 6 to Level 10
Level 6 --> Level 7 :
The password for the next level is stored somewhere on the server and has all of the following properties:
- owned by user bandit7
- owned by group bandit6
- 33 bytes in size
下一級的密碼存儲在服務器上的某個位置,並具有以下所有屬性:
由用戶 bandit7 所有
由群組 bandit6 所有
大小為 33 bytes
因為不知道檔案在哪個路徑,所以先將路徑切換到跟目錄 /
執行 find 搜尋檔案
-type f : 搜尋目標是一個檔案
-user bandit7 : owned by user bandit7
-group bandit6 : owned by group bandit6
-size 33c : 檔案大小指定為 33 bytes
2>/dev/null : 將 permission deny 的直接輸入到黑洞
指令 : find -type f -user bandit7 -group bandit6 -size 33c 2>/dev/null
不切換到跟目錄的話可以這樣下
指令 : find / -type f -user bandit7 -group bandit6 -size 33c 2>/dev/null
搜尋到檔案 : ./var/lib/dpkg/info/bandit7.password
直接 cat 後得到答案
bandit7 密碼 : z7WtoNQU2XfjmMtWA8u5rN4vzqu4v99S
Level 7 --> Level 8 :
The password for the next level is stored in the file data.txt next to the word millionth
bandit8 密碼 : TESKZC0XvTetK0S9xNwm25STk5iWrBvP
Level 8 --> Level 9 :
The password for the next level is stored in the file data.txt and is the only line of text that occurs only once
登入後一樣 ls 即可看到 data.txt,所以就直接下 sort & uniq 指令
指令 : cat data.txt | sort | uniq -u
uniq 參數 : -u 只輸出沒有重複的文字行,-c 重複的次數統計
bandit9 密碼 : EN632PlfYiZbn3PhVK3XOGSlNInNE00t
Level 9 --> Level 10 :
The password for the next level is stored in the file data.txt in one of the few human-readable strings, preceded by several ‘=’ characters.
指令 : cat data.txt | strings | grep ^=
strings 可以將二進位檔可閱讀部份輸出到螢幕上
輸出後透過 grep 顯示開頭是 "=" 的字串,亦可直接輸出包含 "=" 的字串
輸出一看就知道答案是哪一個了
bandit10 密碼 : G7w8LIi6J3kTb8A7j9LgrywtEUlyyp6s
Level 10 --> Level 11 :
The password for the next level is stored in the file data.txt, which contains base64 encoded data
ls 確認檔案,接著 cat 可以看到只有一行
題目提到 base64 編碼,所以直接將輸出結果用 base64 --decode 解碼即得答案
bandit11 密碼 : 6zPeziLdR2RKNdNYFNb6nVCKzphlXHBM
留言
張貼留言