はじめに
今回はTryHackMeのBasic Pentestingを解いてみたので、そのWriteUPを書いていきたいと思います。
自分は約2時間程度で全ての問題を解き終わることが出来ましたので、時間の参考にしてみてください。
WriteUP
Find the services exposed by the machine
攻略するマシンのサービスの列挙です。
nmapを使ってポートスキャンをしていきます。
|
|
これでポートの列挙が出来ました。

What is the name of the hidden directory on the web server(enter name without /)?
hidden derectoryを探す問題です。
gobusterを実行してあげます。
|
|
無事hidden directoryを見つけることが出来ました。

User brute-forcing to find the username & password
まずは、ポートスキャンで得た情報から、SMBが動いていることがわかります。
そのため、smbからUsernameを獲得しようと考え、今回はenum4linuxを使用しました。
|
|
What is the username?
enum4linuxからの情報で、2つのユーザーを見つけることが出来ました。

What is the password?
nmapにてSSHのポートが開いていることが確認できたので、hydraを使ってパスワードのブルートフォースを試していきます。
|
|
Enumerate the machine to find any vectors for privilege escalation
まずは先程獲得した他のユーザのディレクトリを確認し、特権昇格できそうな情報を探していきます。

最終的にpass.bakの中身を確認できればこのRoomは完了しそうだなぁというのを頭にいれつつ、.sshディレクトリの中身を見ていきます。

id_rsaが読み取り可能になっているので、そこから特権昇格を狙っていこうと思います。
If you have found another user, what can you do with this information?
獲得したid_rsaでssh接続を試みてみます。

しかし、パスフレーズを求められてしまいました。
ここで、SSH2Johnを使って、SSH Key Passwordの解析を試みます。
|
|
|
|
無事パスワードがわかったので、ログインしていきます。
|
|
What is the final password you obtain?
ログインが出来たので、最終的なフラグをゲットして終わりです。
|
|
まとめ
今回はTryHackMeのBasic Pentestingを解いてみました。
これを解く前にLeaning PathのCOMPLETE BEGINNERを全て解いていたので、詰まりそうになったときはヒントを見たり、前の章をさらっと復習をすることをオススメします。