3 min read

Complete Guide
Intermediate

Mobile Security

Mobile application security testing involves analyzing the application binary (static analysis), interacting with the running application (dynamic analysis), and intercepting network traffic.

Mobile Pentesting Methodology

1. Reconnaissance

App Store, Permissions, Architecture

2. Static Analysis

Decompile, Code Review, Secrets

3. Dynamic Analysis

Frida, Runtime Hooking, Bypass

4. Network Analysis

Proxy, SSL Pinning, API Testing

5. Data Storage

Keychain, SharedPrefs, SQLite

Platforms

Advanced Topics

Data Storage Locations

Storage Type Android iOS Risk Level
Secure Storage Android Keystore Keychain Services Low
Preferences SharedPreferences NSUserDefaults Medium
Database SQLite / Room Core Data / SQLite Medium
Files /data/data/app/files/ Documents/Library Medium
External Storage /sdcard/ N/A High
Cache /data/data/app/cache/ Caches/ High
Logs logcat Console.app High

Quick Setup

Testing Environment

For Android, use an emulator with Google Play or a rooted physical device. For iOS, a jailbroken device is required for full dynamic analysis capabilities.

For a phone you can carry into the field, the Kali NetHunter setup guide covers the LineageOS flash and NetHunter install — it wipes the device and trips Knox, so read its warnings before you start.

Android Setup

# Install core tools
pip install frida-tools objection

# Start emulator with writable system
emulator -avd Pixel_API_30 -writable-system

# Push Frida server
adb push frida-server /data/local/tmp/
adb shell chmod 755 /data/local/tmp/frida-server
adb shell /data/local/tmp/frida-server &

iOS Setup

# Install tools (macOS)
brew install libimobiledevice ideviceinstaller

# On a jailbroken device, install Frida from a package manager that still
# serves packages, or push the server binary over SSH and start it

# Connect and verify
idevice_id -l
frida-ps -U

OWASP Mobile Top 10

The ten categories below are the 2024 list, in the order it publishes them. The M-number identifies a category; the pages that follow tag a finding with the category it exercises, and grade severity separately.

M1 Improper Credential Usage
M2 Inadequate Supply Chain Security
M3 Insecure Authentication/Authorization
M4 Insufficient Input/Output Validation
M5 Insecure Communication
M6 Inadequate Privacy Controls
M7 Insufficient Binary Protections
M8 Security Misconfiguration
M9 Insecure Data Storage
M10 Insufficient Cryptography

Cross-Platform Tools

Frida

Instrumentation
Docs

Dynamic instrumentation toolkit for developers, reverse-engineers, and security researchers.

Installation

pip install frida-tools

Objection

Instrumentation
Docs

A runtime mobile exploration toolkit, powered by Frida.

Installation

pip install objection

MobSF

Analysis
Docs

Mobile Security Framework - automated all-in-one mobile application pen-testing framework.

Installation

docker run -p 8000:8000 opensecurity/mobile-security-framework-mobsf

Burp Suite

Proxy
Docs

The standard for intercepting and modifying HTTP/HTTPS traffic from mobile apps.

Installation

# Download from website

Drozer

Android
Docs

Comprehensive security assessment framework for Android. Test IPC endpoints and content providers.

Installation

pip install drozer

Ghidra

Reverse Engineering
Docs

NSA's software reverse engineering framework. Excellent for native library analysis.

Installation

# Download from website

Legal Disclaimer

Only test mobile applications you own, have developed, or have explicit written authorization to test. Reverse engineering apps may violate terms of service. Always get proper authorization before testing.