Trustwave's 2024 Retail Report Series Highlights Alarming E-Commerce Threats and Growing Fraud Against Retailers. Learn More
Get access to immediate incident response assistance.
Get access to immediate incident response assistance.
Trustwave's 2024 Retail Report Series Highlights Alarming E-Commerce Threats and Growing Fraud Against Retailers. Learn More
During a recent test, I encountered a native JNI library used by an Android application. I needed to understand this library and what it did, so the first step was to load the library in IDA to see what it looked like. It did not take long until I realized I was looking at obfuscated code that was doing a lot of manipulation on the stack. Understanding the library through static analysis alone would take a long time, so the best way forward would be to combine static and dynamic analysis.
Having debugged a lot of iOS apps using GDB, I started looking at debugging Android apps with GDB. Until this point, DEX2JAR, Smali and some other tools had been sufficient for my Android reversing requirements.
Some research lead me to a discussion at xda-developers about Android debugging through the remote debugging functionality in IDA.
Below is a description of the steps I had to take before I could start debugging the library in question. In this case I used the Android emulator, but this should work just as well on a rooted device.
Depending on what is being analyzed, it is possible to do a memory dump from the process into IDA and save the IDB. This may be good for future analysis, and there is always a risk of a crash somewhere that can terminate the debug session.
Also, if you have the library or file to be analyzed open in IDA before the debugger is attached, IDA should identify the memory address shift (due to ASLR) and ask if you want to rebase the file / library.
Trustwave is a globally recognized cybersecurity leader that reduces cyber risk and fortifies organizations against disruptive and damaging cyber threats. Our comprehensive offensive and defensive cybersecurity portfolio detects what others cannot, responds with greater speed and effectiveness, optimizes client investment, and improves security resilience. Learn more about us.
Copyright © 2024 Trustwave Holdings, Inc. All rights reserved.