又有一道坑题来啦!!!

题目链接

打开
Bugkuctf web速度要快查看源码,没什么东西
Bugkuctf web速度要快
审查元素,也没什么东西

Bugkuctf web速度要快结合,提示的 “快点”这个词,我们容易想到抓包

Bugkuctf web速度要快看到一个flag,容易看出是base64,于是解码

Bugkuctf web速度要快带进去一试,好吧,不是flag,没那么简单

再解码一次Bugkuctf web速度要快

一堆数字,感觉应该不是flag,没这么简单吧,应该。

尝试一下,好吧果然又不是

再次点击go,发现后面的

Bugkuctf web速度要快一直在变化,什么原因呢?
想半天,返回到源代码,发现

Bugkuctf web速度要快
看来是要写脚本了

上代码

import requests
import base64
url = 'http://123.206.87.240:8002/web6/'
session = requests.Session()
req = session.get(url)
header_flag = req.headers['flag']
header_flag_decode = base64.decodestring(header_flag)
margin_value = header_flag_decode.split(": ")[1]
print(margin_value)
post_page = session.post(url,{"margin":base64.decodestring(margin_value)})
print(post_page.text)

Base64模块

encodestring, decodestring一组, 专门用来编码和解码字符串

详解
要学习更多知识的请看上方详解

split()
str.split(str="", num=string.count(str)).
通过指定分隔符对字符串进行切片,如果参数 num 有指定值,则分隔 num+1 个子字符串

margin_value = header_flag_decode.split(": ")[1]
上方的句子意思是
先以:(注意有个空格)分隔,然后取第二段,也就是变化的那一段!

运行脚本得flag

相关文章:

  • 2021-11-28
  • 2021-08-25
  • 2022-12-23
  • 2021-05-17
  • 2021-10-31
  • 2021-12-18
  • 2021-10-27
  • 2021-09-27
猜你喜欢
  • 2021-11-07
  • 2021-10-15
  • 2021-05-30
  • 2021-08-23
  • 2022-12-23
  • 2021-10-11
  • 2022-12-23
相关资源
相似解决方案