Conducting Mobile App Penetration Test
When to Use
- Testing mobile applications before release to identify security vulnerabilities and data protection issues
- Conducting compliance assessments against OWASP MASVS (Mobile Application Security Verification Standard) levels L1 and L2
- Evaluating the security of mobile banking, healthcare, or government applications handling sensitive data
- Testing mobile apps that interact with backend APIs to assess the end-to-end security of the mobile ecosystem
- Assessing mobile application resistance to reverse engineering, tampering, and runtime manipulation
Do not use against mobile applications without written authorization from the application owner, for distributing modified or repackaged applications, or for testing apps on the public app stores without a separate test build.
Prerequisites
- Target application IPA (iOS) and APK (Android) files or access to download from a private distribution channel
- Rooted Android device or emulator (Genymotion, Android Studio AVD) with Frida, Objection, and Magisk installed
- Jailbroken iOS device or Corellium virtual device with Frida, Objection, and SSL Kill Switch installed
- Static analysis tools: jadx (Android decompilation), Hopper/Ghidra (iOS binary analysis), MobSF (automated scanning)
- Burp Suite Professional configured as proxy for intercepting mobile app traffic with CA certificate installed on the test device
Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.
Workflow
Step 1: Static Analysis
Analyze the application binary without executing it:
Android Static Analysis:
- Decompile the APK:
jadx -d output/ target.apk to obtain Java/Kotlin source code
- Review
AndroidManifest.xml for exported components (activities, services, receivers, content providers), permissions, and debuggable flag
- Search for hardcoded secrets:
grep -rn "api_key\|password\|secret\|token\|aws_" output/
- Identify insecure data storage patterns: SharedPreferences with sensitive data, SQLite databases without encryption, files in external storage
- Check for WebView vulnerabilities:
setJavaScriptEnabled(true), addJavascriptInterface(), and loading untrusted content
- Run MobSF automated scan:
python manage.py runserver and upload the APK for automated static analysis
iOS Static Analysis:
- Extract the IPA and locate the Mach-O binary
- Use
otool -L <binary> to list linked frameworks and identify third-party libraries
- Analyze with Ghidra or Hopper for hardcoded URLs, API endpoints, and embedded credentials
- Check Info.plist for App Transport Security (ATS) exceptions that allow insecure HTTP connections
- Review embedded entitlements for excessive capabilities
Step 2: Network Security Testing
Intercept and analyze all network communications:
- Configure Burp Suite as proxy on the test device and install the Burp CA certificate
- Exercise all application functionality while Burp captures API traffic
- SSL/TLS validation: Verify the app validates server certificates properly. If the app fails to connect through the proxy, it may implement certificate pinning.
- Certificate pinning bypass:
- Android: Use Frida script:
frida -U -f com.target.app -l ssl-pinning-bypass.js --no-pause
- iOS: Use SSL Kill Switch or Objection:
objection -g "Target App" explore --startup-command "ios sslpinning disable"
- API traffic analysis: Review all API calls for:
- Sensitive data transmitted without encryption
- Authentication tokens in URL parameters (visible in logs)
- Excessive data in API responses beyond what the UI displays
- Missing or weak authentication on API endpoints
- WebSocket and custom protocols: Check for non-HTTP communication channels that may bypass standard proxy interception
Step 3: Data Storage Analysis
Test for insecure local data storage:
Android Data Storage:
- Access app data directory:
/data/data/com.target.app/
- Check SharedPreferences XML files for stored credentials, tokens, and PII
- Examine SQLite databases:
sqlite3 /data/data/com.target.app/databases/*.db ".dump"
- Check for sensitive data in application logs:
logcat -d | grep -i "password\|token\|key"
- Verify that application data is excluded from backups:
android:allowBackup="false" in AndroidManifest.xml
- Check clipboard for sensitive data leakage
iOS Data Storage:
- Examine the Keychain for stored credentials:
objection -g "Target App" explore then ios keychain dump
- Check NSUserDefaults/plist files:
find /var/mobile/Containers/Data/Application/ -name "*.plist" -exec plutil -p {} \;
- Inspect SQLite databases and Core Data stores for unencrypted sensitive data
- Check for data leaking through screenshots (iOS captures screenshots during app backgrounding)
- Verify data protection class: sensitive files should use NSFileProtectionComplete
Step 4: Authentication and Session Management
Test mobile-specific authentication controls:
- Biometric bypass: Test if biometric authentication can be bypassed by hooking the authentication callback with Frida to always return success
- Token storage: Verify that authentication tokens are stored in the Keychain (iOS) or Android Keystore, not in SharedPreferences or files
- Session timeout: Verify that sessions expire after a reasonable idle timeout and that tokens are invalidated server-side on logout
- Root/jailbreak detection bypass: Test if the app detects rooted/jailbroken devices and if the detection can be bypassed with Frida or Magisk Hide
- Deep link abuse: Test if custom URL schemes or universal links can be used to bypass authentication or access restricted functionality
Step 5: Runtime Manipulation
Test the application's resistance to runtime attacks:
- Frida hooking: Use Frida to hook and modify application functions at runtime:
- Bypass root detection: hook the detection function to return false
- Modify return values of authentication checks
- Intercept encryption functions to capture plaintext data before encryption
- Bypass certificate pinning by hooking SSL verification
- Method swizzling (iOS): Use Frida to replace Objective-C method implementations
- Intent manipulation (Android): Send crafted intents to exported components:
adb shell am start -n com.target.app/.InternalActivity -e "user_id" "admin"
- Tampering detection: Modify the APK/IPA (add code, change resources), re-sign, and install. Verify whether the app detects tampering.
📎 Detailed content (full examples / references / data tables) has been split into reference.md in the same directory; use Read to load the relevant section on demand.
1---2name: conducting-mobile-app-penetration-test3description: "Conduct penetration testing of iOS and Android mobile applications. Signals: mobile, Android attacks, iOS attacks."4zh-signals: "Conducts penetration testing of iOS and Android mobile applications 信号:移动端,android攻击,ios攻击。"5when-to-use: 'Conducts penetration testing of iOS and Android mobile applications6 following the OWASP Mobile Application Security Testing Guide (MASTG) to identify7 vulnerabilities in data storage, network communication, authentication, cryptography,8 and platform-specific security controls. The tester performs static analysis of9 application binaries, dynamic analysis at runtime, and API security testing to evaluate10 the complete mobile attack surface. Activates for requests involving mobile app11 pentest, iOS security assessment, Android security testing, or OWASP MASTG assessment.1213 '14domain: cybersecurity15subdomain: penetration-testing16tags:17- mobile-pentest18- OWASP-MASTG19- Android-security20- iOS-security21- mobile-application-security22version: 1.0.023author: mahipal24license: Apache-2.025nist_ai_rmf:26- MEASURE-2.727- MAP-5.128- MANAGE-2.429atlas_techniques:30- AML.T007031- AML.T006632- AML.T008233nist_csf:34- ID.RA-0135- ID.RA-0636- GV.OV-0237- DE.AE-0738mitre_attack:39- T142640- T140941- T1521.00342- T163343- T141744- T142245metadata:46 source: https://skillmd.com/skills/dangeroussong/conducting-mobile-app-penetration-test47---4849# Conducting Mobile App Penetration Test5051## When to Use5253- Testing mobile applications before release to identify security vulnerabilities and data protection issues54- Conducting compliance assessments against OWASP MASVS (Mobile Application Security Verification Standard) levels L1 and L255- Evaluating the security of mobile banking, healthcare, or government applications handling sensitive data56- Testing mobile apps that interact with backend APIs to assess the end-to-end security of the mobile ecosystem57- Assessing mobile application resistance to reverse engineering, tampering, and runtime manipulation5859**Do not use** against mobile applications without written authorization from the application owner, for distributing modified or repackaged applications, or for testing apps on the public app stores without a separate test build.6061## Prerequisites6263- Target application IPA (iOS) and APK (Android) files or access to download from a private distribution channel64- Rooted Android device or emulator (Genymotion, Android Studio AVD) with Frida, Objection, and Magisk installed65- Jailbroken iOS device or Corellium virtual device with Frida, Objection, and SSL Kill Switch installed66- Static analysis tools: jadx (Android decompilation), Hopper/Ghidra (iOS binary analysis), MobSF (automated scanning)67- Burp Suite Professional configured as proxy for intercepting mobile app traffic with CA certificate installed on the test device686970> **Legal Notice:** This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.7172## Workflow7374### Step 1: Static Analysis7576Analyze the application binary without executing it:7778**Android Static Analysis:**79- Decompile the APK: `jadx -d output/ target.apk` to obtain Java/Kotlin source code80- Review `AndroidManifest.xml` for exported components (activities, services, receivers, content providers), permissions, and debuggable flag81- Search for hardcoded secrets: `grep -rn "api_key\|password\|secret\|token\|aws_" output/`82- Identify insecure data storage patterns: SharedPreferences with sensitive data, SQLite databases without encryption, files in external storage83- Check for WebView vulnerabilities: `setJavaScriptEnabled(true)`, `addJavascriptInterface()`, and loading untrusted content84- Run MobSF automated scan: `python manage.py runserver` and upload the APK for automated static analysis8586**iOS Static Analysis:**87- Extract the IPA and locate the Mach-O binary88- Use `otool -L <binary>` to list linked frameworks and identify third-party libraries89- Analyze with Ghidra or Hopper for hardcoded URLs, API endpoints, and embedded credentials90- Check Info.plist for App Transport Security (ATS) exceptions that allow insecure HTTP connections91- Review embedded entitlements for excessive capabilities9293### Step 2: Network Security Testing9495Intercept and analyze all network communications:9697- Configure Burp Suite as proxy on the test device and install the Burp CA certificate98- Exercise all application functionality while Burp captures API traffic99- **SSL/TLS validation**: Verify the app validates server certificates properly. If the app fails to connect through the proxy, it may implement certificate pinning.100- **Certificate pinning bypass**:101 - Android: Use Frida script: `frida -U -f com.target.app -l ssl-pinning-bypass.js --no-pause`102 - iOS: Use SSL Kill Switch or Objection: `objection -g "Target App" explore --startup-command "ios sslpinning disable"`103- **API traffic analysis**: Review all API calls for:104 - Sensitive data transmitted without encryption105 - Authentication tokens in URL parameters (visible in logs)106 - Excessive data in API responses beyond what the UI displays107 - Missing or weak authentication on API endpoints108- **WebSocket and custom protocols**: Check for non-HTTP communication channels that may bypass standard proxy interception109110### Step 3: Data Storage Analysis111112Test for insecure local data storage:113114**Android Data Storage:**115- Access app data directory: `/data/data/com.target.app/`116- Check SharedPreferences XML files for stored credentials, tokens, and PII117- Examine SQLite databases: `sqlite3 /data/data/com.target.app/databases/*.db ".dump"`118- Check for sensitive data in application logs: `logcat -d | grep -i "password\|token\|key"`119- Verify that application data is excluded from backups: `android:allowBackup="false"` in AndroidManifest.xml120- Check clipboard for sensitive data leakage121122**iOS Data Storage:**123- Examine the Keychain for stored credentials: `objection -g "Target App" explore` then `ios keychain dump`124- Check NSUserDefaults/plist files: `find /var/mobile/Containers/Data/Application/ -name "*.plist" -exec plutil -p {} \;`125- Inspect SQLite databases and Core Data stores for unencrypted sensitive data126- Check for data leaking through screenshots (iOS captures screenshots during app backgrounding)127- Verify data protection class: sensitive files should use NSFileProtectionComplete128129### Step 4: Authentication and Session Management130131Test mobile-specific authentication controls:132133- **Biometric bypass**: Test if biometric authentication can be bypassed by hooking the authentication callback with Frida to always return success134- **Token storage**: Verify that authentication tokens are stored in the Keychain (iOS) or Android Keystore, not in SharedPreferences or files135- **Session timeout**: Verify that sessions expire after a reasonable idle timeout and that tokens are invalidated server-side on logout136- **Root/jailbreak detection bypass**: Test if the app detects rooted/jailbroken devices and if the detection can be bypassed with Frida or Magisk Hide137- **Deep link abuse**: Test if custom URL schemes or universal links can be used to bypass authentication or access restricted functionality138139### Step 5: Runtime Manipulation140141Test the application's resistance to runtime attacks:142143- **Frida hooking**: Use Frida to hook and modify application functions at runtime:144 - Bypass root detection: hook the detection function to return false145 - Modify return values of authentication checks146 - Intercept encryption functions to capture plaintext data before encryption147 - Bypass certificate pinning by hooking SSL verification148- **Method swizzling** (iOS): Use Frida to replace Objective-C method implementations149- **Intent manipulation** (Android): Send crafted intents to exported components: `adb shell am start -n com.target.app/.InternalActivity -e "user_id" "admin"`150- **Tampering detection**: Modify the APK/IPA (add code, change resources), re-sign, and install. Verify whether the app detects tampering.151152> 📎 Detailed content (full examples / references / data tables) has been split into `reference.md` in the same directory; use Read to load the relevant section on demand.