Writeup
[Group 1] Misc大陆旅游指南
PDF隐写,原理是白色文字在白色背景难以发现,可以通过将PDF内容复制到文本文档进行查看
[Group 1] 哈斯通用语词典 可以看到密文里只有“哈基米”“南北绿豆”“曼波”三种,是一种换表的Morse,映射关系如下
按照映射替换后进行Morse解密
| coctf{Stego_1s_Interesting} |
| 哈基米 南北绿豆 曼波--> " " --> "."--> "-" |
得到Flag
[Group 1] 黑白棋阵的奥秘
观察密文,只有“@”和“#”两种,并且总数量成平方关系,可以隐约看到二维码的标识符区域。这里有两 种方法
| coctf{MAM1MAMIH0NG984689} |
方法一
直接替换,在记事本中查看
但是效果不好,微信扫的出来
方法二
写Python代码,使用PIL库生成二维码
| from PIL import Image def read_pattern_from_file(file_path): with open(file_path, 'r') as file: lines = [line.strip() for line in file.readlines() if line.strip()] pattern = [] for line in lines: pattern.append(list(line)) width = len(pattern[0]) height = len(pattern) return pattern, width, height def create_image_from_pattern(pattern, width, height): pic = Image.new("1", (width, height)) for y in range(height): for x in range(width): pixel_value = 1 if pattern[y][x] == '#' else 0 pic.putpixel((x, y), pixel_value) pic.show() |
| pic.save("flag.png") print("图像已保存为 flag.png")file_path = "attachment.txt" # 替换为你的txt文件路径 try:pattern, width, height = read_pattern_from_file(file_path) print(f"图像尺寸: {width}x{height}") create_image_from_pattern(pattern, width, height)except Exception as e: print(f"错误: {e}") |
通过Python生成的效果会好得多
[Group 1] 齐贝斯林!贝斯低语者
Base64一般末尾会有=,但是这个恰好没有,问题不大。不管是题目还是描述一直在提到Base,这道题 同样也有两种方法。
方法一
使用basecrack进行解码,但是数据量大后会很慢 方法二
还是通过我们的Python代码(Python代码很重要,也很方便),通过Base库直接循环解码
| import base64 def base64count(src): num = 0 while True: try: decoded = base64.b64decode(src.encode('utf-8')) src = decoded.decode('ascii') num += 1 print(f"Time {num}:{src}") except Exception as e: return src, num with open('attachment.txt', 'r', encoding='utf-8') as file: content = file.read().strip() result, count = base64count(content) print(f"\n总解码次数: {count}") print(f"最终结果: {result}") |
[Group 1] “先知”的预言 BrainFuck的换表加密
| "+" --> "↑" "-" --> "↓" "." --> "^" |
按照映射替换后进行BrainFuck解密
[Group 1] 故障机器人0k@be
简单编程题,围绕eval函数即可解题
| from pwn import * io = remote("ctf.ctbu.edu.cn",33896) try: while True: io.recvuntil(b"Q:") ans = int(eval(io.recvuntil(b"=",drop=True).decode())) io.sendlineafter("请输入答案:",str(ans))except: io.interactive() |
[Group 2] 静谧之眼 Silenteye工具解密,得到Flag
[Group 2] 无字天书 不可见字符组成二进制,使用自带记事本无法查看,需要写代码读取或者通过Subline Text
| coctf{Lo0Ok_at_Meeee!} |
替换成01后进行二进制转字符串得到Flag [Group 3] Easier_五重枷锁
第一重,可以看到压缩包的备注中有“Refuse violence”的提示,翻译为“拒绝暴力”,Zip暴力攻击,得到 密码
第二重,可以看到压缩包的备注中有“coctf[0-9]{6}”的提示,Zip掩码攻击,得到密码 第三重,可以看到压缩包有一个password.txt,Zip的字典攻击,得到密码 第四重,可以压缩包伪加密,实际无密码
修复后解压得到Flag
[Group 3] Easier_Zip塔的无尽长廊 压缩包套娃,编写Python脚本
[Group 3] Emo_Zip
zip明文爆破,借助png头已知作为明文,通过bkcrack进行明文爆破 制作PNG头文件
进行明文爆破
| echo 89504E470D0A1A0A0000000D49484452 | xxd -r -ps > png_header |
| ./bkcrack.exe -C atachment.zip -c 她不知道的事.png -p png_header -o 0 bkcrack 1.7.1 - 2024-12-21 [16:19:45] Z reduction using 9 bytes of known plaintext 100.0 % (9 / 9)[16:19:45] Attack on 748950 Z values at index 6 Keys: 81a89685 9907e1a1 37a88abe 23.9 % (179026 / 748950) Found a solution. Stopping. You may resume the attack with the option: --continue-attack 179026 [16:20:25] Keys 81a89685 9907e1a1 37a88abe |
通过key解压
也可以修改密码(也可以爆破密码,但是不推荐)
得到Flag
[Group 2] 后日谈 — 奇怪的宣传单
右侧有图形Morse,窄为".",宽为"-",Morse解码得到Flag
[Group 2] 后日谈 — Wakt的魔盒 预测明文攻击,如感兴趣可以私聊讨论。前置建议先完成Emo_Zip
| ./bkcrack.exe -C atachment.zip -c flag.txt -k 81a89685 9907e1a1 37a88abe -d flag.txt bkcrack 1.7.1 - 2024-12-21 [16:22:22] Writing deciphered data flag.txt Wrote deciphered data (not compressed). |
| ./bkcrack.exe -C atachment.zip -c flag.txt -k 81a89685 9907e1a1 37a88abe -U atachment_solved.zip 666 |
| coctf{HAAVEAGO0DTIME} |
Comments NOTHING