Mobile Application Penetration Testing: Assessing Android & iOS Apps
Why Mobile Apps Matter in Pakistan
Mobile money services such as easypaisa, JazzCash, and emerging FinTech apps are core to the digital economy. Threat actors increasingly distribute malicious APKs via WhatsApp forwards, OLX, and Daraz listings. A red team must be able to assess both Android and iOS applications for vulnerabilities such as insecure storage, weak authentication, and API leakage.
Toolset Overview
- Android: Android Studio, MobSF, Frida, adb, Apktool.
- iOS: objection, Frida, ios-deploy, Radare2 (for binary analysis).
- Network: Burp Suite, mitmproxy for intercepting API traffic.
Assessment Methodology (OWASP Mobile Top 10)
- Information Gathering β Decompile APK with apktool, inspect
AndroidManifest.xmlfor exported components. - Static Analysis β Run MobSF to flag insecure permissions, hardβcoded credentials, and improper SSL pinning.
- Dynamic Analysis β Use Frida to bypass SSL pinning and hook sensitive methods (e.g.,
java.net.HttpURLConnection). - Runtime Manipulation β Modify app behavior with objection to test for root detection bypass.
- API Testing β Intercept traffic with Burp; check for IDOR, weak JWT validation, or missing rate limiting.
- Data Storage Review β Examine shared preferences, SQLite databases, and log files for sensitive data leakage.
HandsβOn Lab: Identifying Insecure Data Storage in an Android App
- Install the target APK on a rooted Android device.
- Open a shell and locate the database file:
find /data/data/<package> -name "*.db". - Pull the database:
adb pull /data/data/<package>/databases/users.db .. - Inspect with SQLite Browser; note plaintext passwords or PII.
- Document findings: screenshot the database, record the file path, and calculate risk rating.
- Remediation β Recommend using EncryptedSharedPreferences or the Android Keystore.
Reporting & Compliance
- Align findings with PTAβs data protection regulations and SBPβs mobile banking security directives.
- Provide a CVSS score for each vulnerability and a clear remediation roadmap.
- Use the NCCIA 1799 reporting template for incidents involving personal data exposure.
Do / Don't
- Do: Always test within a sandboxed environment; avoid live financial accounts.
- Don't: Distribute modified APKs outside the lab; doing so may violate Pakistani cybercrime law.
Takeaway
By mastering mobile app testing, you can uncover critical flaws before attackers exploit them via WhatsApp forwards or rogue marketplace listings. Incorporate findings into your red team report to help Pakistani FinTech firms meet NADRA and PTA compliance standards.
