签个到吧
bf语言的输出语句为一个.(点)
所以我们给[-]前都加上一个点再运行即可得到flag
曼波曼波曼波
扫描二维码是一个假的flag,txt中有一串倒序的base64,编写脚本输出后解密可以得到
保存为一张图片,binwalk发现有压缩包
分离出来后可以得到一张图片,一个压缩包(里面也有一张图片),提示
那就XYCTF2025,解压后得到一张一样的,双图隐写盲水印,直接上B神的工具
会飞的雷克萨斯
根据题目描述可以得知是之前四川省小孩炸下水道的那件新闻,百度一搜便出来了
通过图片可以看出一楼店铺有美宜佳,小东十七和一间医疗美容,根据小吃店和美容店进行定位,可以得知位置处于中铁城市中心,flag格式最后是4个字,即城市中心即可
flag{四川省内江市资中县春岚北路城市中心内}
XGCTF
根据题目描述在ctfshow的题目列表中找到对应的题目,名为polluted
接着使用关键词搜索dragonkeep wp
在dragonkeep师傅的博客边栏中找到web方向的题型后拉到最底下找到对应的polluted题目,在页面源码中找到flag,base64解码即可
Greedymen
把规则丢给大模型,可以得知是taxman game,并且得知基本解决思路为贪心算法
脚本如下
import math
import subprocess
import time
def get_factors(n):
return set(f for i in range(1, int(math.sqrt(n)) + 1) if n % i == 0 for f in (i, n // i)) - {n}
def greedy_choose(available, chosen):
legal_choices = []
for num in available:
factors = get_factors(num)
if not factors or (factors - chosen): # 合法选择
legal_choices.append(num)
if not legal_choices:
return None
best_choice = None
best_value = -float('inf')
for num in legal_choices:
gain = num
enemy_gain = sum(f for f in get_factors(num) if f in available)
value = gain - enemy_gain
if value > best_value:
best_value = value
best_choice = num
return best_choice
def play_level(proc, level_max, max_turns):
available = set(range(1, level_max + 1))
chosen = set()
my_choices = []
enemy_choices = []
count = 0
while count < max_turns:
# 读取直到出现 choose 提示
while True:
line = proc.stdout.readline()
if not line:
return
print(line.decode(errors="ignore"), end="")
if b"choose" in line.lower():
break
choice = greedy_choose(available, chosen)
if choice is None:
print("[!] 无可选数字")
proc.stdin.write(b"1\n") # 避免卡死
proc.stdin.flush()
continue
print(f"[+] 第 {count+1} 轮选择: {choice}")
proc.stdin.write(f"{choice}\n".encode())
proc.stdin.flush()
my_choices.append(choice)
chosen.add(choice)
available.remove(choice)
for f in get_factors(choice):
if f in available:
enemy_choices.append(f)
chosen.add(f)
available.remove(f)
count += 1
return my_choices, enemy_choices, available
def main():
proc = subprocess.Popen(['nc', 'gz.imxbt.cn', '20465'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
# 等待菜单
while True:
line = proc.stdout.readline()
if not line:
break
print(line.decode(errors="ignore"), end="")
if b">" in line:
proc.stdin.write(b"1\n")
proc.stdin.flush()
break
total_my_choices = []
total_enemy_choices = []
# Level 1
print("\n[🔰 LEVEL 1]")
my1, enemy1, rem1 = play_level(proc, 50, 19)
total_my_choices += my1
total_enemy_choices += enemy1 + list(rem1)
# Level 2
print("\n[⚔️ LEVEL 2]")
my2, enemy2, rem2 = play_level(proc, 100, 37)
total_my_choices += my2
total_enemy_choices += enemy2 + list(rem2)
# Level 3
print("\n[🔥 LEVEL 3]")
my3, enemy3, rem3 = play_level(proc, 200, 76)
total_my_choices += my3
total_enemy_choices += enemy3 + list(rem3)
# 继续看输出和 flag
print("\n[🎉 游戏结束,进入交互模式,可查看结果或 flag]")
print("🟢 我选择的数字(按顺序):", total_my_choices)
print("🔴 敌人获得的数字(按顺序):", total_enemy_choices)
try:
while True:
line = proc.stdout.readline()
if not line:
break
print(line.decode(errors="ignore"), end="")
except KeyboardInterrupt:
print("\n退出。")
if __name__ == "__main__":
main()