实验吧-web-python编程-天下武功唯快不破

流程

第一步

查看源代码,发现要上传的东西为:key


查看网页源代码

按F12,点网络,重新加载



点击

发现响应头中flag,base64密文

然后代码跑起来

import requests
import base64

print(requests.post(url,data = {'key':str(base64.b64decode(requests.get(url).headers["flag"])).split(':')[1][:-1]}).text)

相当于以下代码

import requests
import base64

url = "http://ctf5.shiyanbar.com/web/10/10.php"  #获取url
flag = requests.get(url).headers["flag"]         #从响应头中获取flag密文
# print(flag)
temp =str(base64.b64decode(flag))                #base64解码转字符形数据
# print(temp)
key = temp.split(':')[1][:-1]                    #截取要提交的key
# print(key)

anwser = requests.post(url,data = {'key':key}).text  #提交
print(anwser)                                    #输出结果




你可能感兴趣的:(实验吧-web-python编程-天下武功唯快不破)