zoukankan      html  css  js  c++  java
  • 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。。。。因为

  • 相关阅读:
    SQL注入(手工篇)
    sed命令
    交互输入与for语句
    编程原理
    grep与正则表达式
    重定向和管道符
    shell_oneday_历史命令相关
    python_01_初识python
    C# 上传文件
    C# in 参数化处理 (记)
  • 原文地址:https://www.cnblogs.com/remon535/p/13799098.html
Copyright © 2011-2022 走看看