Domanda

密码验证.apk

这是一个ctf题,给我解题

Pensiero

Final steps and solution writeup in Chinese

The flag contains valid characters like [ and (. The CTF flag should be ISCC{?DnKE8URXk_t4FUC*FpK.(3EM(v[Fp}, which is 36 bytes in total. I’ll produce the solution steps and concise code while avoiding unnecessary verbosity. Including key findings like decoding constants, decryption, and verification should cover the approach. I'll also provide a concise Python script for solving.

Thought for 3m 40s

Risposta

解出来了。

Flag:

text
ISCC{?DnKE8URXk_t4FUC*FpK.(3EM(v[Fp}

核心校验在 native 层:

text
lib/x86_64/libnativecrypto.so Java_com_example_crypto_NativeBridge_verifyFlag

校验流程是:

  1. Java 层 NativeBridge.verifyFlag(assetManager, input) 调 native。
  2. native 先判断格式:
text
长度 = 36 前缀 = ISCC{ 后缀 = }
  1. 中间 30 字节拆成三段:
text
part1: 8 字节 part2: 12 字节 part3: 10 字节
  1. assets 里有 4 个密文文件:
text
cipher1.bin = 3b ac 82 e4 84 b7 cd 97 cipher2.bin = 10 6e b0 63 df c9 61 4a 11 be 2c 19 cipher3.bin = d5 99 90 2f f3 4f 30 9f a5 80 puzzle.bin = 26 53 a3 74 b1 27 15 a7 86 9e a5 af a4 15 8d 2d 1c ea 6a 0a
  1. native 里三组常量先经过:
c
dec(x) = ((x - 0x13) & 0xff) ^ 0x5a

得到:

text
K1 = 1a2b3c4d5e6f708192a3b4c5d6e7f809 K2 = 01000000000100000000010000000001 K3 = aabbccdd11223344556677889900feed

然后生成中间 key/mask:

text
k13 = 904f4d43c5c7c5c34d4fe706e4b090f0 mask = f51f2c6a6e92a15490a362dfb3462439

三段还原结果:

text
part1 = ?DnKE8UR part2 = Xk_t4FUC*FpK part3 = .(3EM(v[Fp

拼回去就是:

text
ISCC{?DnKE8URXk_t4FUC*FpK.(3EM(v[Fp}

其中 part1 是 TEA-16 轮解密后再异或 mask;part2 是 AES GF(2^8) 矩阵方程求逆;part3 是用 native 里的 64-bit LCG 生成 keystream 后异或。puzzle.bin 还有一个针对 part1 前 4 字节的 GF 校验,计算结果正好是 1c ea 6a 0a,通过。

Domanda

蔡文姬.txt

这是一个ctf题,给我解题

Pensiero

Providing final solution with instructions

Since I can't access Baidu from the sandbox, I should tell the user to upload the app-release.zip for analysis. I’ll explain that once uploaded, I can decompile and provide the flag and script. I'll keep the message concise and clarify that I can't access the link directly. Citations can be included.

Thought for 23s

Risposta

你上传的 蔡文姬.txt没有题目附件本体,只有百度网盘分享信息:app-release.zip 的链接和提取码 6xq5。(蔡文姬.txt)

我这边尝试打开该百度网盘链接,但当前环境无法访问这个链接。(Not applicable) 所以现在还不能反编译/分析 app-release.zip,也就没法给出 flag。

请直接把 app-release.zip 上传到聊天里,不要只发网盘链接。上传后我会继续做完整解题流程,通常包括:

text
解压 APK / ZIP 反编译 dex 查看 AndroidManifest / MainActivity 查找校验逻辑 分析 native so / assets / 加密算法 还原 flag 给出解题脚本

Condividi questa Q&A