• IDF实验室-简单编程-字符统计 writeup


    题目地址:http://ctf.idf.cn/index.php?g=game&m=article&a=index&id=37

    网站:http://ctf.idf.cn/game/pro/37/

    主要是要有2秒的限制。写个python 脚本。

    #!usr/bin/env python
    #!coding=utf-8
    
    import requests
    import re
    __author__ = 'zhengjim'
    
    
    url = 'http://ctf.idf.cn/game/pro/37/'
    res = requests.get(url)
    _cookies = res.cookies
    a = res.text
    b = re.findall(r'<hr />(.*)<hr />',a,re.S)
    c = ','.join(b)
    w = str(c.count('w'))
    o = str(c.count('o'))
    l = str(c.count('l'))
    d = str(c.count('d'))
    y = str(c.count('y'))
    anw = w+o+l+d+y
    print anw
    
    payload = {'anwser':anw}
    asd = requests.post("http://ctf.idf.cn/game/pro/37/",cookies=_cookies, data=payload)
    print asd.content

    程序很简单。  

    关键是提示时的cookies要与第一次访问的cookies一样,否则会提醒花儿都谢啦。

  • 相关阅读:
    面试常见问题
    Servlet上传下载
    Java五大框架
    Jquery
    JavaEE
    Html学习
    JavaSE高级
    面向过程基础
    Java开发软件安装及配置
    JAVA的类加载机制和Class类
  • 原文地址:https://www.cnblogs.com/zhengjim/p/6105020.html
Copyright © 2020-2023  润新知