b01lers CTF 2025
比赛地址:b01lers CTF 2025
比赛时间:19 Apr 2025 07:00 CST - 21 Apr 2025 07:00 CST
复现的题目用🔁标注
Web
when
Challenge
web/whenbeginner
author: tillvit
the sunk cost fallacy
app.ts
1 | import express from 'express' |
Solution
检查 /gamble 路由的逻辑发现服务端会检查请求头中的 Date 字段。如果存在,则将其解析为时间戳;否则使用当前时间。时间戳会被转换为秒级时间(Math.floor(time.getTime() / 1000)),然后将时间戳传递给 gamble 函数,该函数计算时间戳的 SHA-256 哈希值。如果前两个字节的值分别为 255 和 255(即二进制表示为 1111111111111111),服务器会就返回 flag ,否则服务器会返回前两个字节的二进制表示。
因此我们要做的就是伪造一个 Date 请求头,使得时间戳经过 SHA-256 哈希计算后前两个字节恰好是 255 和 255。
1 | import requests |
得到以下响应
1 | {'success': True, 'result': '1111111111111111', 'flag': 'bctf{ninety_nine_percent_of_gamblers_gamble_81dc9bdb}'} |
1 | bctf{ninety_nine_percent_of_gamblers_gamble_81dc9bdb} |
trouble at the spa
Challenge
web/trouble at the spa
author: ky28059
I had this million-dollar app idea the other day, but I can’t get my routing to work! I’m only using state-of-the-art tools and frameworks, so that can’t be the problem… right? Can you navigate me to the endpoint of my dreams?
Solution
关键代码:
1 | import { StrictMode } from 'react'; |
通过浏览器扩展(Tampermonkey)注入脚本,强制触发路由跳转
1 | // ==UserScript== |
然后直接访问 https://ky28060.github.io/ 就会跳转到 https://ky28060.github.io/flag

1 | bctf{r3wr1t1ng_h1st0ry_1b07a3768fc} |
Reverse
class-struggle
Challenge
rev/class-strugglebeginner
author: CygnusX & ky28059
I miss the good old days before OOP, when we lived in a classless, stateless society…
1 |
|
Solution
ChatGPT 一把梭
这道题通过一系列宏定义把「输入字符串 g[i]」经过三步变换后,与给定的字节数组比较。我们要做的是把这三步变换反过来,从目标数组还原出原始的 g[i]。
一、理解正向变换
对于每个索引 i 和字符 j = g[i],正向变换分三步:
异或与旋转
1
2j ^= (i * 37); // XOR 运算,结果截断到 8 位
j = rol(j, (i + 3) % 7); // 向左循环移位 r = (i+3)%7加常数 42
1
j = (j + 42) & 0xFF; // 加法并截断到 8 位
提取高低 4 位后再旋转
1
2x = (j & 0xF0) | ((~j) & 0x0F); // 高 4 位保留,低 4 位取 ~j 的低 4 位
e = ror(x, i % 8); // 向右循环移位 r = i%8,得到最终字节最终的
e就存储在给定数组中。
二、反向还原算法
逆向第二次旋转
1
2# 已知 e 和 r2=i%8
x = rol(e, r2) # 旋转方向相反:向左旋转 r2 位逆向高低位提取
由x = (z & 0xF0) | ((~z) & 0x0F),可解得1
2
3
4z_high = x & 0xF0
x_low = x & 0x0F
z_low = 0xF - x_low # 因为 (~z_low)&0x0F = x_low ⇒ z_low = 0xF - x_low
z = z_high | z_low逆向加 42
1
t1 = (z - 42) & 0xFF
逆向第一次旋转
1
2r1 = (i + 3) % 7
t2 = ror(t1, r1) # 向右循环移位的逆运算逆向异或
1
j = t2 ^ ((i * 37) & 0xFF)
得到的
j就是当时的g[i]。
1 | # 8 位循环移位函数 |
运行后即可得到 flag
1 | bctf{seizing_the_m3m3s_0f_pr0ducti0n_32187ea8} |
- 标题: b01lers CTF 2025
- 作者: Aristore
- 创建于 : 2025-04-21 11:34:00
- 更新于 : 2025-04-21 11:31:00
- 链接: https://www.aristore.top/posts/b01lersCTF2025/
- 版权声明: 版权所有 © Aristore,禁止转载。