实验吧-天下武功,唯快不破

天下武功,唯快不破

原题链接

http://ctf5.shiyanbar.com/web/10/10.php

分析

There is no martial art is indefectible, while the fastest speed is the only way for long success.
没有武术是不可摧毁的,而最快的速度是获得长期成功的唯一途径。
>>>>>>----You must do it as fast as you can!----<<<<<<
查看源码
<!-- please post what you find with parameter:key -->

发现响应头有FLAG,并且FLAG会变

HTTP/1.1 200 OK
Date: Tue, 07 Aug 2018 07:36:40 GMT
Server: Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/5.3.29
X-Powered-By: PHP/5.3.29
FLAG: UDBTVF9USElTX1QwX0NINE5HRV9GTDRHOnpoN1dtNlMzQQ==
Content-Length: 216
Connection: close
Content-Type: text/html

解码为P0ST_THIS_T0_CH4NGE_FL4G:zh7Wm6S3A,大概意思是我们要POST key='ChangeString'

但是问题是,这个key在响应头里,不可能直接POST,至少得先接受一下。
猜测是有时间限制,但是session会保留一小会,这段时间的key是一样的。
但是由于时间的限制,所以只能写脚本接受数据,POST。

#coding:utf-8
import requests
import base64

url = 'http://ctf5.shiyanbar.com/web/10/10.php'

res = requests.get(url)
key = base64.b64decode(res.headers['FLAG']).split(':')[1]
print key
Postdata = {'key':key}
res = requests.post(url=url,data=Postdata)
print res.text

结果

Ee28JfTyP
CTF{Y0U_4R3_1NCR3D1BL3_F4ST!}
[Finished in 0.4s]

flag

CTF{Y0U_4R3_1NCR3D1BL3_F4ST!}

知识点

requests库,base64编码,session

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值