CTF-速度要快100

CTF-速度要快100

这道题需要用到一个小脚本运行,具体操作如下:

 

 

F12看到提示

解码再POST上去发现提示

百度一下要用到脚本

import requests

import base64

 

url = 'http://123.206.87.240:8002/web6/'

req = requests.session()

res = req.get(url)

 

#获取请求头中的flag

flag = res.headers['flag']

 

#对flag进行base64解码 --- 得到的是bytes类型

txt = base64.b64decode(flag)

 

#把bytes类型转换成str类型 --- 即对其进行解码

txt = bytes.decode(txt)

 

#截取字符串flag后面的字段

txt = txt[txt.index(":")+2:]

 

#然后再对其进行base64解码

txt = base64.b64decode(txt)

 

#根据题目提示 now you have to post the margin what you find --- 需要根据margin属性进行post请求提交

#构造data,另margin属性为爆破出来的txt

data = {'margin': txt}

 

 

ans = req.post(url,data)

print (ans.text)

得到flag

 

总结:脚本跑,理解session涵义,理解一些python用法 例如requests的一些请求和提交,转换解码方法

原文地址:https://www.cnblogs.com/cxl862002755/p/13227175.html