Room: Banking trojan
Room scenario. Unauthorised transfers occurred from a bank customer's account. A backup of the customer's phone (device_backup.ab), a suspicious app found on the phone (overlay_malware.apk) and the trojan server's API log (server_api.log) were handed to the investigator. The archive is fraud_case.zip.
Technical notes: .ab — a 4-line text header (ANDROID BACKUP, version, compression flag, encryption 'none'), followed (if compression = 1) by a tar stream compressed with zlib. The APK is a zip under the name .apk that has already been unpacked with apktool (smali and assets/). Nothing is installed or run.
Stages (answers are not submitted):
- Task 1. Open the backup and find the device's
ANDROID_IDvalue (settings_secure.xml). Other files of the app also contain similar values — which one does the trojan use? Read the smaliCfg.smali. - Task 2. Decrypt
assets/c.binthe way the smali shows (how the key is derived, which AES mode). What is written in the configuration: the bot identifier, the command format (kx, base64url), the SMS upload format and the OTP pattern? - Task 3. Find this victim's bot in
server_api.log(the log is full of other bots, and one is a decoy — a similar scenario). Decode thecmdfield in the/v2/cresponses according to the configuration format: whichsms_forwardcommands, for which sender? - Task 4. From the SMS messages uploaded by this bot (
/v2/u), take only the codes that match the OTP pattern in the configuration (resends are repeatedn), join them innorder and convert to ASCII — that is the flag.
Flag format: BAYROQ{...} (the last 16 characters are lowercase hex).