TryHackMe(THM):AttackerKB
目次
- Task 1 I'm attacking what now?
- Task 2 Discovering the Lay of the Land
- Scan the machine with Nmap. What non-standard service can be found running on the high-port?
- Further enumerate this service, what version of it is running?
- Visit the webpage generated by this service. You should encounter an error due to SSL being present. Change the URL to use HTTPS and ignore the exception. After this, view the certificate. What hostname can we find on the cert details? On Firefox, you can view this by clicking on the 'i' in the URL, then the '>' in Connection, 'More Information', and then 'View Certificate' on the Security tab.
- Adjust your /etc/hosts file accordingly to include the newly discovered hostname and revisit the webpage in question. Note, that this will confirm that the service we previously discovered using Nmap is correct. Once you've done this, move onto task three.
- Task 3 Learning to Fly
- Take a look through the Assessments for this vulnerability. As an attacker, we can use the information posted here by other members to determine how value an exploit might be and any tweaks we might have to make to exploit code. Similarly, as a defender we can leverage these comments to gain additional situational information for vulnerabilities, allowing us to gauge how quickly we need to patch them. Which version of Webmin is immediately vulnerable to this exploit?
- What type of attack was this? Note, we're looking for how this was added to the code for Webmin, not how this results in remote code execution (RCE).
- Can you find a link to a post on the webmin's website explaining what happened? What day was Webmin informed of an 0day exploit? Can you find a link to a post on the webmin's website explaining what happened? What day was Webmin informed of an 0day exploit?
- Last but certainly not least, let's find the link to our exploit. We can see in the Assessments that a Metasploit module was added for this backdoor. What pull number was this added in?
- Task 4 Blasting Away
この記事は、DeepL翻訳を利用して和訳しています。
Task 1 I'm attacking what now?
Ever caught wind of a new vulnerability on Twitter or found something weird when examining a box? Fear no more, AttackerKB is here to make sense of it all! Throughout this room, we'll be examining how we can leverage AttackerKB both as an attacker and defender to gain further insight into the ever-changing landscape of vulnerabilities.
Twitterで新しい脆弱性の情報を得たり、箱を調べていて変なものを見つけたりしたことはありませんか?そんな時はAttackerKBにお任せください。この部屋では、AttackerKBを攻撃者としても防御者としても活用し、刻々と変化する脆弱性の状況をより深く理解するための方法を検討します。
A standalone version of the virtual machine used in this room can be found in this room. Additionally, you can download the OVA of Source for offline usage from https://www.darkstar7471.com/resources.html
この部屋で使われている仮想マシンのスタンドアロン版は、この部屋で見ることができます。さらに、オフラインで使用するSourceのOVAは、
https://www.darkstar7471.com/resources.html
からダウンロードできます。
Task 2 Discovering the Lay of the Land
Scan the machine with Nmap. What non-standard service can be found running on the high-port?
まずnmapを実行します。
# nmap -sV -sC <$IP>
22番ポート(SSH)と10000番ポート(http)の2ポートが解放されています。
ハイポートで動作している非標準のサービスなので、httpポートのアプリケーション名を解答します。
Further enumerate this service, what version of it is running?
nmapの結果からアプリケーションのバージョン情報が表示されているのでそれを回答します。
Visit the webpage generated by this service. You should encounter an error due to SSL being present. Change the URL to use HTTPS and ignore the exception. After this, view the certificate. What hostname can we find on the cert details? On Firefox, you can view this by clicking on the 'i' in the URL, then the '>' in Connection, 'More Information', and then 'View Certificate' on the Security tab.
設問にあるように-ブラウザでWebページにアクセスします。そのときにポート番号を指定することを忘れずに。
ブラウザのアドレス欄にある鍵マークをクリックします。
安全でない接続の右横の「>」をクリックします。
画面下の「詳細を表示」をクリックします。
ページ情報画面が表示されるので、[証明書を表示]ボタンを押下します。
すると、設問の解答であるホスト名が表示されます。
Adjust your /etc/hosts file accordingly to include the newly discovered hostname and revisit the webpage in question. Note, that this will confirm that the service we previously discovered using Nmap is correct. Once you've done this, move onto task three.
問題文にあるように/etc/hostsファイルを適宜修正します。
# vi /etc/hosts
この修正は必要ないかな?
Task 3 Learning to Fly
AttackerKBにアクセスしてみます。
画面右上のSearchボックスに「Webmin」で検索します。
検索結果から「password_change.cgi」をクリックしてください。
Take a look through the Assessments for this vulnerability. As an attacker, we can use the information posted here by other members to determine how value an exploit might be and any tweaks we might have to make to exploit code. Similarly, as a defender we can leverage these comments to gain additional situational information for vulnerabilities, allowing us to gauge how quickly we need to patch them. Which version of Webmin is immediately vulnerable to this exploit?
この脆弱性の評価に目を通します。
攻撃側としては、他のメンバーが投稿した情報を利用して、脆弱性を利用するための価値や、脆弱性を利用するために必要なコードの調整を行うことができます。
防御側としては、これらのコメントを活用して、脆弱性に関する追加の状況情報を得ることができ、どの程度早くパッチを当てる必要があるかを判断することができます。
画面をスクロールすると、コメントにバージョン情報が書かれていました。
What type of attack was this? Note, we're looking for how this was added to the code for Webmin, not how this results in remote code execution (RCE).
これも上の投稿内容に攻撃内容が書かれていました。
Can you find a link to a post on the webmin's website explaining what happened? What day was Webmin informed of an 0day exploit? Can you find a link to a post on the webmin's website explaining what happened? What day was Webmin informed of an 0day exploit?
webminのサイトで「1.890 Exploit」で検索すると0dayの日付がわかります。
Last but certainly not least, let's find the link to our exploit. We can see in the Assessments that a Metasploit module was added for this backdoor. What pull number was this added in?
GitHubで「password_change.cgi backdoor exploit」をキーワードに検索すると設問の追加された番号の答えが見つかります。
Task 4 Blasting Away
Now that we've selected our exploit, set the options provided appropriately. Beyond RHOSTS and LHOST, what is the third option we must set to 'True'?
今回はMetasploitモジュールを使用するので、Metasploitを起動してください。
# msfconsole
Metasploitが起動したら、searchコマンドでwebminで検索します。出力結果からbackdoorのコードを選択します。
optionコマンドで設定するコマンドを確認します。
LHOSTに自分のIPアドレス 、RHOSTSにVirtualマシンのIPアドレス 、もう一つは設問の解答を設定します。
Run the exploit. What is the user flag?
exploitを実行します。
コマンドが入力できる状態になったら、現在のディレクトリを確認します
lsコマンドでディレクトリやファイルを確認すると、意味深なディレクトリ名を発見しました。
ls -al
そのディレクトリの中を確認するとuser.txtファイルを見つけました。
How about the root flag?
最後にrootフラグなので、とりあえずlsコマンドでrootディレクトリを確認してみます。
なんと現在の権限で見ることができました。 ということは、このディレクトリにroot.txtファイルがあるので、中身を確認します。
終了!