We were approached by a client—whose identity must remain confidential—to assist in reverse-engineering Asan Diag, a car diagnostic application. The goal was to access and download the app’s database, which was protected by multiple layers of security.
What is Asan Diag?
Asan Diag is a mobile diagnostic software that connects to a vehicle’s OBD2 port via a hardware interface. It provides users with real-time information on error codes, fuel consumption, engine efficiency, and overall vehicle status.
Key Challenges:
The Asan Diag application employed several layers of authentication, authorization, and encryption to protect its data. This presented a significant reverse engineering challenge.
Our Approach and Solutions:
- Initial Code Modification and APK Rebuild: Using tools such as Ghidra, JD-GUI, and APKTool, we carefully analyzed the app’s code written in SAMLI, Java, C++, and Assembly. After thoroughly studying the code, we modified it and built a new APK that allowed us to download the encrypted database from the app.
- Decrypting the Database: Upon retrieving the database, we discovered that it was protected by a second layer of encryption. Additionally, the encryption key was concealed using an obfuscated method. Through further analysis, we identified the encryption key, successfully decrypted the core data, and gained access to the database.
- Decrypting Encrypted Data Rows: In the final phase, we found that certain database tables contained row-level encryption. With persistence, we identified the encryption algorithm and successfully decrypted the row-level data as well.
Outcome:
Despite the multi-layered encryption and security protocols, we successfully reverse-engineered the Asan Diag application, gaining full access to its database and underlying data. This project was an exceptionally complex case, requiring deep knowledge of code analysis, cryptography, and reverse engineering techniques.