APKrypt
XESXOR8/23/20262 min read
#mobile#htb#n/a
APKrypt
Platform: HackTheBox | Category: Mobile | Difficulty: N/A | Author: D3v0o0Nu11 | Date: 2026-02-10
Description
Can you get the ticket without the VIP code?
Solution Approach
Core idea: Identify the weakness from source review or fingerprinting first. Iterate with incremental payloads instead of guessing.
Steps
- As usual, the problem setter recommend us to use the API >= 29 to install the apk.
- Because we need to do zipalign and assign our keystore if we want to install it in API 33.
- Since i only have the API 33, let us do zipalign and sign the key to our new apk.
NOTES:
To see the command used for zipalign - make our own keystore - sign the key to apk, open this writeup --> ../../Mobile/APKey/README.md
- Great let us install the apk using adb and open it on our emu.
It asks us to input a VIP code and it seems we need to find the correct code.
- Let us decompile the apk with jadx-gui.
INTEREST POINT (Main Activity).
- Already tried to crack the hardcoded md5 with
crackstation(online tools) but it didn't works, hence it seems we need to tamper the if-statement. - Let us decode the apk with
apktool.
COMMAND:
apktool d patched.apk
JUMP TO THE VSCODE AND OPEN THE SMALI CODE.
What we want to patch (green box) - change it to nez.
SAVE then, run this command to build the apk again.
apktool b -o patchedv1.2.apk patched
Zipalign the apk again then sign it with apksigner.
zipalign -p 4 patchedv1.2.apk deploy_patched.apk
apksigner sign --ks a.keystore deploy_patched.apk
Install the apk again, the input random strings. It will decrypt the flag, because our input's hash will not equal to the hardcoded hash.
- Got the flag!
Flag
REDACTED
Lessons Learned
- Identify the weakness from source review or fingerprinting first.
- Iterate with incremental payloads instead of guessing.
- Reuse the same pattern in future engagements.