70006¥

IT & DIARY 自己満ブログ

OverTheWire - Level0~Level1

問題:

OverTheWire: Level Goal

Bandit Level 0 → Level 1

Level Goal

The password for the next level is stored in a file called readme located in the home directory. Use this password to log into bandit1 using SSH. Whenever you find a password for a level, use SSH (on port 2220) to log into that level and continue the game.

Commands you may need to solve this level

ls, cd, cat, file, du, find

 

 

今回の問題は次のlevelに行くためのpasswordがreadmeって言うファイルに書いているからreadmeを読めば解決できる。

とりあえず、homeにどんなファイルがあるか確認。

f:id:psharp:20180708035439p:plain

ls -alはla -aとls -lを合わせた感じで、ドットで始めるファイルとファイルの詳細を出力するって言う意味。

 

一番最後に出る

-rw-r----- 1 bandit1 bandit0 33 Dec 28 2017 readme

に注目。

問題で要求したreadmeと言うファイルがこのdirectoryにあることが分かった。

すぐ cat readme でファイルを読んで見よう

f:id:psharp:20180708041809p:plain

(passwordは途中までしか写ってない。)

次のlevelへのpasswordが出てくる。

 

以上がlevel0~level1の過程です。

 

 

 

 

参考:

【 ls 】 ファイル情報を出力する 【 Linuxコマンドまとめ 】 | Linux Fan