Mobile Pentest Methodology
Mobile pentesting covers three things at once: the app (the APK/IPA binary and its code), its communication with the backend, and how it stores data on the device. Unlike the web, here the code runs on a device the user —and the attacker— controls physically, so anything the app stores or decides locally can be inspected and manipulated. The industry reference is OWASP MASVS (the requirements standard) together with MASTG (the testing guide), which structure the whole process and give traceability to every finding.
flowchart LR
BIN["APK/IPA binary"] --> SAST["Static analysis"]
BIN --> ENV["Env: root/jailbreak + proxy"]
ENV --> DAST["Dynamic analysis (Frida)"]
DAST --> STORE["Local storage"]
DAST --> NET["Traffic + SSL pinning"]
NET --> API["Backend / API"]
API --> REP["Report mapped to MASVS"]
STORE --> REP
SAST --> REP
Threat model
Section titled “Threat model”Before testing anything, define who the app defends against and what the attacker gains in each scenario:
- Compromised device: root/jailbreak, malware with permissions, or a user who wants to bypass controls in their own app (game cheats, unlocking premium features).
- Attacker on the network: MITM over WiFi/carrier trying to read or alter the app-backend traffic.
- Another app on the same device: abuses exported components, deeplinks, or shared storage.
- Physical access or backup: extracts data from a lost/stolen device or a cloud backup.
- The backend as the real target: the app is just a client; the API is the surface where business logic and data live.
The guiding principle: never trust the client. Everything running on the device is inspectable and manipulable; real security must live on the server.
The three surfaces
Section titled “The three surfaces”- The app (static): the binary, its code, secrets, configuration, and permissions, without running it.
- The running app (dynamic): live behaviour, storage, memory, crypto, authentication.
- The communication: traffic with the backend, where the Web attacks apply directly.
Static vs dynamic
Section titled “Static vs dynamic”- Static (SAST): decompile the APK/IPA and review code, resources, permissions, and secrets without running the app. Fast for hardcoded keys, endpoints, and insecure configuration. Tools:
apktool,jadx,class-dump, MobSF. - Dynamic (DAST): run the app on a device/emulator and instrument it with Frida to observe and modify its behaviour: storage, crypto, authentication, and SSL pinning in real time.
The two complement each other: static tells you where to look, dynamic confirms and exploits it.
OWASP MASVS: the categories
Section titled “OWASP MASVS: the categories”MASVS v2 groups requirements into control groups that act as a testing map:
- MASVS-STORAGE — data storage (see Insecure Storage).
- MASVS-CRYPTO — correct use of cryptography (see Symmetric Cryptography).
- MASVS-AUTH — authentication and authorization.
- MASVS-NETWORK — secure communication, TLS, and pinning (see SSL Pinning and Bypass).
- MASVS-PLATFORM — platform interaction: IPC, deeplinks, WebViews (see Deeplinks and IPC).
- MASVS-CODE — code quality and updates.
- MASVS-RESILIENCE — anti-tampering, anti-debugging, instrumentation detection, and obfuscation.
Note: the old naming was MSTG (requirements) over the MASTG; MASVS v2 (2023+) uses the MASVS-* groups above.
Red Team
Section titled “Red Team”Workflow for an audit against an app you own or have explicit permission to test:
- Get the binary: APK (Android) or IPA (iOS).
- Static: decompile, review
AndroidManifest.xml/Info.plist, permissions, secrets, and endpoints. - Prepare the environment: rooted/jailbroken device or emulator; proxy (Burp) with its CA.
- Dynamic: run and instrument with Frida/Objection.
- Storage: inspect what it stores and how (Insecure Storage).
- Network: intercept traffic; bypass SSL pinning if present (SSL Pinning and Bypass).
- Platform: deeplinks, IPC, and exported components (Deeplinks and IPC).
- Backend: test the API like a web app (Web Methodology, IDOR/BOLA).
Quick triage with MobSF to decide where to dig:
# automated static analysis (manifest, permissions, secrets, crypto)mobsf# upload the APK/IPA via the local web UI (http://127.0.0.1:8000) and review the reportWhat almost always shows up: hardcoded secrets (API keys, internal URLs), insecure cleartext storage, missing or bypassable pinning, exposed components/deeplinks, and broken authorization in the backend.
Blue Team
Section titled “Blue Team”- Follow MASVS as a design checklist: don’t trust the client, encrypt sensitive data, TLS + pinning, and validate on the backend.
- Don’t hardcode secrets in the app: the binary is inspectable. Use the backend and secret management.
- MASVS-RESILIENCE (anti-tampering, anti-debugging, Frida detection, obfuscation with R8/ProGuard) raises the attacker’s cost but does not replace server-side security.
- Treat the API as the primary surface: every authentication and authorization decision must be made on the backend.
- Integrate static analysis (MobSF, linters) into the CI/CD pipeline to catch regressions.
Checklist
Section titled “Checklist”- Get the binary (APK/IPA)
- Static: manifest/Info.plist, permissions, secrets, endpoints (MobSF, jadx)
- Environment: rooted/jailbroken device or emulator + proxy with CA
- Dynamic with Frida/Objection
- Local storage (Insecure Storage)
- Network: intercept + bypass SSL pinning (SSL Pinning and Bypass)
- Platform: deeplinks/IPC/exported (Deeplinks and IPC)
- Backend/API tested like a web app (Web Methodology)
- Findings mapped to MASVS categories