美文网首页
快速口算 - CTF脚本关 - writeup

快速口算 - CTF脚本关 - writeup

作者: taiji1985 | 来源:发表于2017-12-22 21:11 被阅读198次

http://hackinglab.cn/ShowQues.php?type=scripts

小明要参加一个高技能比赛,要求每个人都要能够快速口算四则运算,2秒钟之内就能够得到结果,但是小明就是一个小学生没有经过特殊的培训,那小明能否通过快速口算测验呢?

测试地址: http://lab1.xseclab.com/xss2_0d557e6d2a4ac08b749b61473a075be1/index.php

import requests
proxies = {
#  "http": "http://127.0.0.1:8080",
}
u = 'http://lab1.xseclab.com/xss2_0d557e6d2a4ac08b749b61473a075be1/index.php'
s = requests.Session()

r = s.get(url=u,proxies=proxies)    # 最基本的GET请求
r.encoding = 'utf-8' 
#r = requests.get(url='http://dict.baidu.com/s', params={'wd':'python'})   #带参数的GET请求
print(r.status_code)    # 获取返回状态
print(r.url)
html = r.text.encode('utf-8', 'ignore')
print(html)
200
http://lab1.xseclab.com/xss2_0d557e6d2a4ac08b749b61473a075be1/index.php
<html>
    <head>
        <meta http-equiv=Content-Type content="text/html;charset=utf-8">
    </head>
    <body>
       
        <form action="" method="post">
            请在2秒内口算结果并提交!<br/>
            3412*59495+94*(3412+59495)=<input type="text" name="v"/>
            <input type="submit" value="提交"/>
        </form>
    </body>
</html>
def getbetween(txt,bs,es):
    b = txt.find(bs)
    e = txt.find(es,b+len(bs))
    r= txt[b+len(bs):e]
    return r

exp = getbetween(html,'<br/>','=').replace(' ','')
print exp
v= eval(exp)
3412*59495+94*(3412+59495)
data = {'v': v}
#headers = {'content-type': 'application/json',
#           'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0'}
#r = requests.post('https://api.github.com/some/endpoint', data=data, headers=headers)

r = s.post(u, data=data,proxies=proxies)

r.encoding = 'utf-8' 



#r = requests.get(url='http://dict.baidu.com/s', params={'wd':'python'})   #带参数的GET请求
print(r.status_code)    # 获取返回状态
print(r.url)
html = r.text.encode('utf-8', 'ignore')
print html
200
http://lab1.xseclab.com/xss2_0d557e6d2a4ac08b749b61473a075be1/index.php
<html>
    <head>
        <meta http-equiv=Content-Type content="text/html;charset=utf-8">
    </head>
    <body>key is 123iohHKHJ%^&*(jkh   </body>
</html>

相关文章

  • 快速口算 - CTF脚本关 - writeup

    http://hackinglab.cn/ShowQues.php?type=scripts 小明要参加一个高技能...

  • 南京邮电ctf-CG-CTF—WEB—WriteUp(持续更新)

    南京邮电ctf-CG-CTF—WEB—WriteUp(持续更新) 南京邮电练习题-CTF练习题 web篇 1.签到...

  • Web

    这是 ISITDTU 的一些 web 题目 来自 ISITDTU CTF 2018 部分Web题目Writeup这...

  • CTF 网鼎杯-MISC-minified-WriteUp

    CTF 网鼎--MISC--minified--WriteUp 0通道为空值 分别保存 green blue a...

  • 实验吧ctf-web-writeup

    这是第一次做CTF题目,之前也是看别人的writeup,很多看不懂,但是今天先在ctf实验吧看了课程-web专题,...

  • [*ctf] web writeup

    小菜鸡又来更新writeup了这次的web我觉得更像是逆向。。。果然复旦的大佬都是全栈高手。。。根本就是。。 si...

  • forms ctf writeup

    一道与cookie,session有关的题目 -条件需要,,''' <?phpsession_start();...

  • Bugku CTF 秋名山老司机 writeup

    Bugku CTF 秋名山老司机 writeup 本题要求计算响应内容中的表达式并用 POST 请求返回结果,实质...

  • CTF_Web_WriteUp

    南邮CTF web write up, 题目是按分数从少到多顺序排列,后续有新的体会会更新 签到题 签到二 右键查...

  • USV-CTF writeup

    关于USV-CTF的介绍以及下载地址如下:https://www.vulnhub.com/entry/usv-20...

网友评论

      本文标题:快速口算 - CTF脚本关 - writeup

      本文链接:https://www.haomeiwen.com/subject/iagxgxtx.html