LoginSignup
1
0

More than 3 years have passed since last update.

[TryHackMe] Advent of Cyber 2, Day 6 - Walkthrough -

Last updated at Posted at 2020-12-07

本稿では、TryHackMeにて提供されている「Advent of Cyber 2」ルームに関する攻略方法(Walkthrough)について検証します。
「Advent of Cyber 2」は「free room」(無料)で提供されています。購読を必要とせずに仮想マシンを「展開(Deploy)」することができます。

『Advent of Cyber 2』のWalkthroughインデックスを「[TryHackMe] Advent of Cyber 2に参加してみた」にて公開しました。

[Day 6] Web Exploitation: Be careful with what you wish on a Christmas night

ストーリー

Day 06.png

今年、サンタさんは完全にデジタル化を達成するため「Make a wish」システムを開発しました。これは非常にシンプルなWebアプリです。人々が匿名で自分の願いを他の人と共有できるようにするものです。残念ながらハッカーの攻撃を受けた直後、セキュリティチームは誰かが「Make a wish」システムに侵入したことを発見しました。願い事のほとんどは消えてしまい、ウェブサイトは悪意のあるウェブサイトにリダイレクトされるようになってしまっています。攻撃者は願い事を送信するふりをして、サーバーへ悪意のあるリクエストを注入した可能性があります!セキュリティチームはMACHINE_IP:5000にバックアップサーバーを用意しました。あなたの目標は、攻撃者がアプリケーションを悪用する方法を見つけることです。

Day 6 - #1.

Deploy your AttackBox (the blue "Start AttackBox" button) and the tasks machine (green button on this task) if you haven't already. Once both have deployed, open Firefox on the AttackBox and copy/paste the machines IP (http://MACHINE_IP:5000) into the browser search bar (the webserver is running on port 5000, so make sure this is included in your web requests).

まずは、Make a wishにアクセスします。[Deploy]ボタンをクリックします。
ブラウザにて割り振られたMACHINE_IP:5000にアクセスします。Make a wishの画面が表示されます。
Make a Wish.png

Day 6 - #2.

What vulnerability type was used to exploit the application?

攻撃者のスクリプトを第三者の Web コンテンツ中に紛れ込ませる手法は、次の3種類に分類できます。

No. 型名 概要
1 Persistent 型 (Stored 型, 蓄積型) Web サイトが蓄積しているコンテンツ中に紛れ込ませる
2 Reflected 型 (反射型) Web サイトが動的に作り出すコンテンツ中に紛れ込ませる
3 DOM 型 Web ブラウザ内に蓄積しているコンテンツ中に紛れ込ませる

解答は「Web サイトが蓄積しているコンテンツに紛れ混ませている」がヒントです。

Day 6 - #3.

What query string can be abused to craft a reflected XSS?

ここは素直に[HINT]に頼りました。
HINT.png

さっそく、Make a wishアプリの[Search Query]に文字列hackを入力してみます。
search bar.png

解答は「アルファベット17番目の文字」がヒントです。

Day 6 - #4.

Launch the OWASP ZAP Application

OWASP ZAPを起動すると、GUIが表示されます。
OWASP_ZAP.png

Day 6 - #5.

Run a ZAP (zaproxy) automated scan on the target. How many XSS alerts are in the scan?

OWASP ZAPの右側ペインにある[Automated Scan]ボタンをクリックします。
[URL to attack:]フィールドにMACHINE_IP:5000を入力し、[Attack]ボタンをクリックします。
ZAP_Automated_Scan.png

検索が終了すると[Alerts]タブに検出された脆弱性が表示されています。

Day 6 - #6.

Explore the XSS alerts that ZAP has identified, are you able to make an alert appear on the "Make a wish" website?

OWASP ZAP[Alerts]タブの内容を確認してみます。
Description.png

[Attack:]項目に記載されている内容(ペイロード)に注目します。

</p><script>alert(1);</script><p>

Make a wishアプリのクエリパラメーターに続けて、[Attack:]項目に記載されているペイロードを入力します。次のとおり、アラートを表示させることに成功しました。

alert.png

6日目のミッションが終了です。

参考になるTryHackMeのルーム

参考情報

Walkthrough

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0