[b01lers2020]Scrambled
解题步骤
脑洞题,cookie可疑
其中:Set-Cookie: transmissions=kxkxkxkxsh5c32kxkxkxkxsh;
刷新了几次,其中间内容变动,左右两侧kxkxkxkxsh均无变动,可疑点研究了很久,没有思路
查看了大佬wp:[b01lers2020]Scrambled(python脚本编写)得到了其代表的意思
例如:
5c32表示flag第32位是c,而它的前一位为5
cd26表示flag第26位是d,而它的前一位为c
等等……
https://blog.csdn.net/weixin_44037296/article/details/112549815
贴一个脚本:
from time import sleep
import requests as rq
import re, urllib
flag = ['_'] * 42
url = "http://a29923a2-e259-4c37-b908-d3ee00da3137.node4.buuoj.cn:81/"
cookies = {"frequency":"1","transmissions":"x"}
while True:
res = rq.get(url, cookies=cookies)
if res.status_code != 200:
sleep(1)
res = rq.get(url, cookies=cookies)
cookie = res.headers["Set-Cookie"].split(';')[3].split('=')[2].replace("kxkxkxkxsh","")
cookie = urllib.parse.unquote(cookie)
if len(cookie) == 4:
index = int(cookie[-2:])
else:
index = int(cookie[-1])
flag[index] = cookie[0]
flag[index + 1] = cookie[1]
print(''.join(flag))
if '_' not in flag:
break