2026-0xGame【web】全解"

admin 2026-10-15 18:19:13 网络安全文章 来源:ZONE.CI 全球网 0 阅读模式

2026-0xGame【web】全解

赛查查

2026年10月12日 18:10
北京

在小说阅读器读本章

去阅读

在公众号小说中沉浸阅读

以下文章来源于玄网安全
,作者opis

玄网安全
.

ctf竞赛交流,网络大臭虫一个

WEB1:ATP代码实验

漏洞在/static/submit.js

/static/protect.js加密混淆解密后大致内容就是说%20ctrl+u%20这类代码进制

payload:

fetch('/submit',%20{
 %20method: 'POST',
 %20headers:%20{ 'Content-Type': 'application/json' },
 %20body:%20JSON.stringify({%20code:%20document.querySelector('#ref-code').textContent%20})
}).then(r%20=>%20r.json()).then(console.log)
WEB2:奶蛙的博客

在/static/hint.js提示

//%20奶蛙的博客%20-%20site%20script
//%20HINT:%20flag%20被%20gzip%20压缩、base64%20编码后拆成了碎片,每页一块,按%20id%20顺序拼起来。
console.log(\"[naiwa]%20hint:%20gzip%20->%20base64%20->%20split,%20join%20fragments%20in%20id%20order\");

payload:

import%20base64
import%20gzip
from%20html.parser%20import%20HTMLParser
from%20urllib.request%20import%20urlopen

BASE%20= \"http://8000-595f5425-5e25-4164-b9b2-433c901a2938.challenge.ctfplus.cn\"

class%20FragmentParser(HTMLParser):
 %20 %20def%20__init__(self):
 %20 %20 %20 %20super().__init__()
 %20 %20 %20 %20self.in_fragment%20=%20False
 %20 %20 %20 %20self.fragments%20=%20[]

 %20 %20def%20handle_starttag(self,%20tag,%20attrs):
 %20 %20 %20  if tag%20== \"span\" and \"flag-fragment\"in dict(attrs).get(\"class\", \"\").split():
 %20 %20 %20 %20 %20 %20self.in_fragment%20=%20True

 %20 %20def%20handle_data(self,%20data):
 %20 %20 %20  if self.in_fragment:
 %20 %20 %20 %20 %20 %20self.fragments.append(data)

 %20 %20def%20handle_endtag(self,%20tag):
 %20 %20 %20  if tag%20== \"span\" and%20self.in_fragment:
 %20 %20 %20 %20 %20 %20self.in_fragment%20=%20False

pieces%20=%20[]
for page_id in range(1,%20125):
 %20 %20with%20urlopen(f\"{BASE}/page?id={page_id}\",%20timeout=10)%20as%20response:
 %20 %20 %20 %20page%20=%20response.read().decode(\"utf-8\")

 %20 %20parser%20=%20FragmentParser()
 %20 %20parser.feed(page)
 %20  if len(parser.fragments)%20!=%201:
 %20 %20 %20 %20raise%20ValueError(f\"id={page_id}:%20找到%20{len(parser.fragments)}%20个碎片\")
 %20 %20pieces.append(parser.fragments[0])

encoded%20= \"\".join(pieces)
flag%20=%20gzip.decompress(base64.b64decode(encoded,%20validate=True)).decode(\"utf-8\")
print(flag)