这是ctf逆向题目,给我分析出flag,并告诉我详细具体的解题步骤和解题脚本

Criado em: 16 de maio de 2026

Respondido usando GPT-5.5 Thinking por Chat01

Pergunta

mob1.apk

这是ctf逆向题目,给我分析出flag,并告诉我详细具体的解题步骤和解题脚本

Pensamento

Finalizing the script and flag output

I think I should adjust the selection sequence using ADFGVX labels and the MD5 target for the UI. The final script should be robust and include custom AES. Once updated, I'll need to ensure there are no warnings or errors, possibly in both English and Chinese with the final flag. I'll also link or include the full solve script and include XOR offsets and symbol names for further clarity.

Creating final script for APK solution

I need to run a script that simulates check() returning true for the final solution, using decompiled logic. The script should work independently and handle APK input via a path, unzip it, and use Pillow for dependencies. It should extract hint.png, parse classes.dex, and hardcode constants for MD5 and decompiled values for the challenge. The script will be named solve_mob1_final.py.

Thought for 8m 31s

Resposta

最终 flag:

text
ISCC{purr_w4tch_adfgBte}

我把完整脚本放在这里了:
下载 solve_mob1_final.py

运行方式:

bash
python3 solve_mob1_final.py mob1.apk

输出为:

text
[+] click points: [(1, 1), (2, 4), (3, 6), (4, 2), (5, 6), (6, 1)] [+] click path: VVGAFXAGDXXV [+] path md5: c0f3e85c34ee0a6703c300aab228d3cc [+] AES-256 key: 95ee4a1793aae778f4856124710a6633efb6c39410a17d405d26822fcbd2afb0 [+] inner: purr_w4tch_adfgBte [+] flag: ISCC{purr_w4tch_adfgBte}

解题步骤

1. APK 结构

解包后关键文件是:

text
classes.dex assets/hint.png assets/sys/OBSERVER_PROTOCOL lib/*/libmobile03.so

Java 层主要类:

text
com.example.mobile03.MainActivity com.example.mobile03._A com.example.mobile03._B com.example.mobile03._C com.example.mobile03._P

其中 _A 会加载 native 库:

java
System.loadLibrary("mobile03");

并且 _A._v() 是 native 方法。


2. Java 层校验逻辑

按钮点击后逻辑大致如下:

java
path = _b._q(); if (!_C._c(path)) { Toast("步伐的韵律不对,密使已消失。"); return; } inner = _b._g(editText); if (inner == null) { Toast("格式错误!"); return; } if (_a.check(context, inner, path)) { Toast("喵!解密成功!"); }

_B._g() 用异或恢复 flag 前缀:

java
byte[] enc = {0x0b, 0x11, 0x01, 0x01, 0x39}; for each b: b ^ 0x42

结果是:

text
ISCC{

同时要求输入以 } 结尾,所以格式是:

text
ISCC{...}

真正送入 native 层校验的是大括号内部内容。


3. 点选路径校验

_C._c() 对点选路径做 MD5:

text
MD5(path) == c0f3e85c34ee0a6703c300aab228d3cc

方阵坐标标签来自 _B._k

text
[V, G, F, A, D, X]

assets/sys/OBSERVER_PROTOCOL 是十六进制编码的文本,解码后给出了约束:

text
Row_Total ≡ 21 Col_Total ≡ 20 隐藏条件: P2.c > P1.c P6.c < P2.c

结合 MD5 爆破,唯一满足条件的路径是:

text
VVGAFXAGDXXV

对应坐标:

text
P1 = (1,1) = VV = 🐾 P2 = (2,4) = GA = 🦋 P3 = (3,6) = FX = 🌿 P4 = (4,2) = AG = ☀️ P5 = (5,6) = DX = 😿 P6 = (6,1) = XV = 🐈‍⬛

这也和界面 hint 文本中的“印记起点、舞动斑斓、清甜气息、光源、黯然、无光轮廓”对应。


4. native 层逻辑

libmobile03.so 中关键符号:

text
_f_val native 总校验 _f_ext 从 hint.png 提取隐藏表 _f1 根据点选路径派生 key _f_exp AES-256 key schedule _f_enc 自定义 S-box AES 加密 _f_d64 base64 decode

_f_ext() 会扫描 hint.png 的像素:

c
if (blue_channel & 1) { bitbuf[i / 8] |= 1 << (7 - i % 8); }

前 4 字节必须是:

text
MEOW

后面 256 字节作为自定义 AES S-box。

native 中保存的密文是:

text
bXaFTKx8hVDPR+qsu0lb9zynNlzKwtqfFMKwMc/uj2E=

base64 解码后再整体异或 0x66,得到真正的 32 字节密文。

点选路径 VVGAFXAGDXXV 经过 _f1() 派生出 AES-256 key:

text
95ee4a1793aae778f4856124710a6633efb6c39410a17d405d26822fcbd2afb0

最后用自定义 S-box AES-256 解密得到:

text
purr_w4tch_adfgBte

所以完整 flag 是:

text
ISCC{purr_w4tch_adfgBte}

Compartilhar esta Q&A