TAMUctf 2025

比赛地址:TAMUctf

比赛时间:29 Mar 2025 06:00 CST - 31 Mar 2025 06:00 CST

复现的题目用🔁标注

Start here!

Howdy World

Challenge

Howdy World

Welcome to TAMUctf 2025!

Please enter the flag from tamuctf.com to prove that you are a real person 😃

The flag format is gigem{.*} unless otherwise specified

Solution

签到题

1
gigem{welcome!}

Forensics

Challenge

Deflated

Author: flocto

I heard ZipCrypto Store has a vulnerability, so I’ve used ZipCrypto Deflate instead. Can you still get the flag?

Notes

  • Flag matches regex gigem{[A-Z0-9_]+}.
  • Do not try to brute force the password. It is not in any password list.

deflated.tar.gz

Solution

附件是一个经过加密的压缩包

题目说不要爆破,但试了一下也不是伪加密,此时打开压缩包发现里面有一个.git 目录

.git 目录内有部分内容是有固定格式的,这就意味着有极大概率是知道部分明文的内容的,再加上压缩包用的是 ZipCrypto Deflate,这一切线索都指向了明文攻击

TAMUctf2025-1

在 Git 中,.git/HEAD 文件通常存储当前所在的分支(或直接指向某个 commit)

默认情况下,它的内容格式如下

1
ref: refs/heads/<branch-name>

因此先从.git/HEAD 入手,构造一个明文文件 plain.txt(至于为什么是 main,是因为现在大多默认分支都是 main,我一试就成功了)

1
ref: refs/heads/main

然后利用 bkcrack 进行明文攻击获取密钥

1
bkcrack -C encrypted.zip -c .git/HEAD -p plain.txt -o 0

输出如下

1
2
3
4
5
6
7
8
9
10
bkcrack 1.7.1 - 2024-12-21
[00:21:03] Z reduction using 13 bytes of known plaintext
100.0 % (13 / 13)
[00:21:03] Attack on 535195 Z values at index 6
Keys: f2635bca a91bec3a ec81bdf9
9.0 % (48070 / 535195)
Found a solution. Stopping.
You may resume the attack with the option: --continue-attack 48070
[00:22:37] Keys
f2635bca a91bec3a ec81bdf9

然后利用密钥 f2635bca a91bec3a ec81bdf9 可以生成一个无密码的新 ZIP 文件

1
bkcrack -C encrypted.zip -k f2635bca a91bec3a ec81bdf9 -D decrypted.zip

输出如下

1
2
3
bkcrack 1.7.1 - 2024-12-21
[00:48:04] Writing decrypted archive decrypted.zip
100.0 % (16 / 16)

解压之后用 VSCode 打开,在源代码管理能找到一条 commit 记录

TAMUctf2025-2

把它签出得到之前提交的代码,运行一下就能看到 flag 了

TAMUctf2025-3

1
gigem{DONT_FEEL_2_DEFLATED}