web-GXYCTF2019 StrongestMind

访问题目,发现需要计算运算式,一千次后给flag

2020数字中国创新大赛虎符网络安全赛道的一道pwn题差不多,但这次我用了正则匹配,也没啥技巧

直接贴exp:

#!/usr/bin/python
import requests,time,re
url="http://86448d73-6092-4944-9e1d-d69378033304.node3.buuoj.cn/index.php"
s=requests.session()
ret=s.get(url)

for i in range(1001): 
 formula=re.findall("[0-9]* [-+*/^%] [0-9]*",ret.content)
 formula=''.join(formula).replace(" ","")
 res=eval(formula)
 url1="http://86448d73-6092-4944-9e1d-d69378033304.node3.buuoj.cn/index.php"
 data={"answer":res}
 ret=s.post(url1,data)
 time.sleep(0.1)
 print ret.content

不用session的话,post提交的答案和本次访问的算式答案不同,因为不是同一个会话了

sleep是为了防止buu的429

for循环的range一定要大于1000。。。。因为

 

posted @ 2020-10-11 20:26  remon535  阅读(408)  评论(0编辑  收藏  举报