ctf python脚本

天下武功唯快不破 

解题链接: http://ctf5.shiyanbar.com/web/10/10.php 
#!/usr/bin/python
# -*- coding:utf8 -

import requests
import base64
url = 'http://ctf5.shiyanbar.com/web/10/10.php'
re = requests.get(url) #请求url
key = re.headers['FLAG'] #获得响应头中的FLAG值 必须带单引号
key = base64.b64decode(key) #base64解码key
s = ':'
key = key[key.find(s)+1:] #分割key值,提取flag值。[+1:]从:到最后
#key = key.split(':')[1]
re = requests.post(url,data={"key":key})#发送带有key的post值 格式不能变
print(re.text)

猜你喜欢

转载自blog.csdn.net/qq_40657585/article/details/83548967
ctf