$ cat writeup.md…
$ cat writeup.md…
HackTheBox
Android reverse engineering challenge involving an APK file with obfuscated code protecting a flag. The application implements a login screen with hardcoded credentials, and upon successful authentication, decrypts and displays the flag.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
Android reverse engineering challenge involving an APK file with obfuscated code protecting a flag. The application implements a login screen with hardcoded credentials, and upon successful authentication, decrypts and displays the flag.
Extracted APK (password: hackthebox)
Decompiled with jadx to obtain Java source:
com.example.apkey.MainActivityc.b.a.* package (single-letter class names)The MainActivity implements a simple authentication check:
a2a3d412e92d896134d9c9126d756fc.b.a.g.a() to get encrypted data and c.b.a.b.a() to decryptThe obfuscation uses multiple helper classes, each returning a string from an array at a specific index:
| Class | Method | Returns | Array Index |
|---|---|---|---|
h | a() | "kHtZuV" | 6 |
i | a() | "rSE6qY" | 4 |
f | a() | "6HxWkw" | 1 |
e | a() | "HyeaX9" | 7 |
c | a() | "FlEGyL" | 4 |
d | a() | "wAxcoc" | 0 |
a | a() | "85S94kFpV1" | 3 |
g.a() - Builds Base64-encoded encrypted string by concatenating values from multiple arraysg.b() - Returns "AES" (cipher algorithm) built from d.a()[1] + i.a()[2] + i.a()[1]b.a() - Decrypts using AES-ECB with key built from character positions across helper functionsEncrypted string (Base64):
1UlBm2kHtZuVrSE6qY6HxWkwHyeaX92DabnRFlEGyLWod2bkwAxcoc85S94kFpV1
AES Key (16 bytes):
kV9qhuzZkvvrgW6F
Key construction uses specific character positions from helper functions with some lowercase transformations.
...
$ grep --similar