Mobile Application Security Testing Framework β A comprehensive toolkit for Android (APK) and iOS (IPA) application security analysis, static/dynamic analysis, traffic interception, and automated OWASP Mobile Top 10 checks with bypass techniques.
β Status: Alpha β All 9 phases complete.
- APK Decompilation β Decompile APKs via apktool with directory tree visualization
- Manifest Analysis β Extract package name, version, SDK levels, debuggable flag, allowBackup, network security config, signing info
- Permission Analysis β List all declared permissions classified by severity (dangerous/normal/signature/custom) with counts
- Component Enumeration β Activities, services, receivers, and content providers with export status and intent-filter detection
- Security Misconfiguration Checks β 8 automated checks:
- Debuggable flag detection
- Backup enabled vulnerability
- Missing network security config
- Low minSdkVersion targeting
- Unnecessarily exported components
- Excessive permission requests
- Sensitive permission combinations (Camera+Mic, Location+Background, etc.)
- Hardcoded Secrets Detection β 23 regex patterns scanning decompiled source for:
- AWS keys, GitHub tokens, Slack tokens, JWT tokens
- Firebase URLs, Google API keys
- Passwords, connection strings, private keys
- OAuth secrets, API keys, and more
- Statistics β File counts, DEX classes, native code detection, obfuscation detection, analysis timing
- JSON Export β Full structured report for integration with other tools
- Rich Terminal Output β Color-coded severity badges, formatted tables, panels, and progress spinners
| Phase | Module | Status |
|---|---|---|
| 1 | APK Analyzer | β Complete |
| 2 | IPA Analyzer | β Complete |
| 3 | Static Analysis Engine (OWASP Mobile Top 10) | β Complete |
| 4 | SSL Pinning Bypass (Frida) | β Complete |
| 5 | Root/Jailbreak Detection Bypass (Frida) | β Complete |
| 6 | Traffic Interception (MITM, HAR analysis, TLS) | β Complete |
| 7 | Dynamic Analysis | β Complete |
| 8 | Code Obfuscation Detection | β Complete |
| 9 | Report Generation | β Complete |
β οΈ Note for Kali Linux / Debian 12+: System-widepip installis blocked to protect the OS. Always use a virtual environment as shown below.
# Clone the repository
git clone https://github.com/Yash-Patil-1/mobilesentry.git
cd mobilesentry
# Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate
# Install MobileSentry (recommended)
pip install -e .
# Or install with extra dependencies
pip install -e ".[analyze]" # For APK analysis (androguard)
pip install -e ".[all]" # All extras
# Verify it works
mobilesentry --helpπ‘ Tip: Add
mobilesentry/venv/binto your PATH or create an alias so you can runmobilesentryfrom anywhere.
APK Analyzer requires:
- apktool β For APK decompilation (secrets scanning)
- Java Runtime β Required by apktool
IPA Analyzer requires:
- plutil β macOS utility for plist conversion (or handled gracefully)
- unzip β For IPA extraction (ZIP archive)
- file β For Mach-O binary detection
- otool β Optional, for encryption detection (macOS only)
# Ubuntu/Debian
sudo apt install apktool default-jre unzip file
# macOS
brew install apktool# List all available bypass techniques
mobilesentry frida list
# List only Android techniques
mobilesentry frida list android
# List only iOS techniques
mobilesentry frida list ios
# Generate all SSL bypass scripts (both platforms)
mobilesentry frida generate
# Generate only Android scripts
mobilesentry frida generate android
# Generate only iOS scripts
mobilesentry frida generate ios
# Specify custom output directory
mobilesentry frida generate all --output ./my_frida_scriptsGenerated scripts are organized by platform:
frida_scripts/
βββ android/
β βββ ssl_universal_android.js # π Best β hooks SSLContext, OkHttp, WebView, TrustKit
β βββ ssl_okhttp_android.js # π― Targeted β OkHttp3/4 CertificatePinner
β βββ ssl_trustmanager_android.js # β
Good β Custom TrustManager injection
β βββ ssl_webview_android.js # π― Targeted β WebView SSL error bypass
β βββ ssl_flutter_android.js # β
Good β Flutter SSL bypass (Dart + native)
β βββ ssl_xamarin_android.js # π― Targeted β Xamarin.Android SSL bypass
βββ ios/
βββ ssl_universal_ios.js # π Best β NSURLSession, AFNetworking, TrustKit
βββ ssl_afnetworking_ios.js # π― Targeted β AFSecurityPolicy bypass
βββ ssl_alamofire_ios.js # π― Targeted β Alamofire ServerTrustManager
βββ ssl_trustkit_ios.js # π― Targeted β TrustKit library bypass
βββ ssl_flutter_ios.js # β
Good β Flutter iOS SSL bypass
βββ ssl_nsurlsession_ios.js # β
Good β Pure NSURLSession/NSURLConnection
Quick usage with Frida:
# Attach to a running Android app
frida -U com.target.app -l frida_scripts/android/ssl_universal_android.js
# Spawn and inject into Android app
frida -U -f com.target.app -l frida_scripts/android/ssl_universal_android.js --no-pause
# Spawn and inject into iOS app
frida -U -f com.target.app -l frida_scripts/ios/ssl_universal_ios.js# List all available root/jailbreak bypass techniques
mobilesentry frida root-bypass list
# List only Android techniques
mobilesentry frida root-bypass list android
# List only iOS techniques
mobilesentry frida root-bypass list ios
# Generate all root/jailbreak bypass scripts (both platforms)
mobilesentry frida root-bypass generate
# Generate only Android root bypass scripts
mobilesentry frida root-bypass generate android
# Generate only iOS jailbreak bypass scripts
mobilesentry frida root-bypass generate ios
# Specify custom output directory
mobilesentry frida root-bypass generate all --output ./my_bypass_scriptsGenerated scripts are organized by platform:
bypass_scripts/
βββ android/
β βββ root_universal_android.js # π Best β Hooks File.exists, Runtime.exec, System.getProperty, Build.TAGS,
β β ProcessBuilder, native access/stat, RootBeer, Superuser, Magisk
β βββ root_magisk_android.js # π― Targeted β Magisk-specific bypass (paths, env, mounts, Zygisk)
β βββ root_rootbeer_android.js # π― Targeted β RootBeer library bypass (all methods + native lib)
β βββ root_safetynet_android.js # π― Targeted β SafetyNet/Play Integrity API bypass
βββ ios/
βββ root_universal_ios.js # π Best β Hooks NSFileManager, stat/access/open, fork/system, dlopen,
β canOpenURL, sysctl, proc_info, sandbox, NSTask
βββ root_cydia_ios.js # π― Targeted β Cydia/Substrate app & library detection bypass
βββ root_liberty_ios.js # π― Targeted β Libhooker/rootless jailbreak bypass (Dopamine, Xina)
βββ root_rootful_ios.js # π― Targeted β Rootful jailbreak bypass (unc0ver, checkra1n)
Quick usage with Frida:
# Attach to a running Android app
frida -U com.target.app -l bypass_scripts/android/root_universal_android.js
# Spawn and inject into iOS app
frida -U -f com.target.app -l bypass_scripts/ios/root_universal_ios.js# List all available runtime monitoring techniques
mobilesentry frida dynamic list
# List only Android techniques
mobilesentry frida dynamic list android
# List only iOS techniques
mobilesentry frida dynamic list ios
# Generate all runtime monitor scripts (both platforms)
mobilesentry frida dynamic generate
# Generate only Android monitor scripts
mobilesentry frida dynamic generate android
# Generate only iOS monitor scripts
mobilesentry frida dynamic generate ios
# Specify custom output directory
mobilesentry frida dynamic generate all --output ./my_monitor_scripts
# Analyze a captured trace file
mobilesentry frida dynamic trace trace.jsonGenerated scripts are organized by platform:
monitor_scripts/
βββ android/
β βββ monitor_universal_android.js # π Best β method calls, file I/O, crypto, DB, network, permissions
β βββ monitor_method_tracer_android.js # β
Good β lightweight sensitive API tracing (Telephony, Accounts, Location, Camera, WebView)
β βββ monitor_crypto_android.js # π― Targeted β Cipher, KeyGenerator, MessageDigest, KeyStore, Signature
β βββ monitor_database_android.js # π― Targeted β SQLiteDatabase, Room, ContentResolver queries
β βββ monitor_file_io_android.js # π― Targeted β File, RandomAccessFile, Context directories, FileObserver
β βββ monitor_network_android.js # π― Targeted β HttpURLConnection, OkHttp, WebSocket, DownloadManager
βββ ios/
βββ monitor_universal_ios.js # π Best β NSFileManager, NSUserDefaults, Keychain, NSURLSession, CLLocation
βββ monitor_method_tracer_ios.js # β
Good β UIDevice, UIApplication, AVCaptureDevice, CNContactStore, WKWebView, CommonCrypto
Quick usage with Frida:
# Attach to a running Android app and capture trace output
frida -U com.target.app -l monitor_scripts/android/monitor_universal_android.js 2>&1 | tee trace.json
# Spawn and inject into app
frida -U -f com.target.app -l monitor_scripts/android/monitor_universal_android.js --no-pause 2>&1 | tee trace.json
# Analyze the captured trace
mobilesentry frida dynamic trace trace.jsonThe DynamicAnalyzer produces a comprehensive report including:
- Event type breakdown (method_calls, file_io, crypto, db_query, network, permission)
- Top methods called with call counts
- Behavioral security findings (crypto volume, sensitive files, SQL injection risks, HTTP requests)
- Sensitive API usage inventory
- Call graph visualization (nodes and edges)
# List all available obfuscation detection techniques (Android + iOS)
mobilesentry obfuscation list
# Analyze an APK for obfuscation
mobilesentry obfuscation analyze app.apk
# Analyze an IPA for obfuscation
mobilesentry obfuscation analyze app.ipa
# Export results as JSON
mobilesentry obfuscation analyze app.apk --jsonObfuscation detection techniques by platform:
Android (8 techniques):
| Technique | Severity | Description |
|---|---|---|
| ProGuard/R8 | π‘ Medium | Standard class/method/field renaming, minification, mapping.txt checks |
| DexGuard | π΄ High | Commercial obfuscation β string encryption, class encryption, anti-tampering |
| String Encryption | π΄ High | XOR/AES-based string decryption, char[] building, decryption helpers |
| Reflection Hiding | π΄ High | Class.forName(), Method.invoke(), DexClassLoader for dynamic dispatch |
| Obfuscator-LLVM | π΄ Critical | Native (.so) code obfuscation β CF flattening, bogus control flow, instruction substitution |
| Packer/DEX Protection | π΄ Critical | UPX packing, DEX encryption, DexClassLoader payloads, anti-debugging |
| Resource Obfuscation | π΅ Low | Shortened/randomized resource names and IDs |
| Arithmetic Obfuscation | π‘ Medium | Constant encoding via expressions, XOR chains |
iOS (6 techniques):
| Technique | Severity | Description |
|---|---|---|
| Symbol Obfuscation | π΄ High | Random short function/class symbol names preventing disassembly |
| ObjC Metadata Obfuscation | π΄ High | Obfuscated class names, selectors, protocol metadata |
| String Encryption (iOS) | π΄ High | Encrypted cstrings, character-by-character decryption in ARM64 |
| OLLVM (iOS) | π΄ Critical | LLVM-level CF flattening, bogus CF, instruction substitution |
| Control Flow Flattening | π΄ High | Switch-dispatch pattern flattening of function CFG |
| Anti-Hooking/Anti-Debug | π‘ Medium | ptrace(), sysctl(), dladdr() debugger/hooking detection |
# Generate all mitmproxy addon scripts (full, minimal, auth)
mobilesentry traffic setup
# Generate only the full-featured addon with device setup guide
mobilesentry traffic setup full --guide
# Generate auth-focused addon
mobilesentry traffic setup auth
# Custom output directory
mobilesentry traffic setup all --output ./my_mitmproxyGenerated addons are organized by type:
mitmproxy_config/
βββ mobilesentry_addon.py # π Full β Real-time security analysis + HAR capture
βββ mobilesentry_minimal_addon.py # π¦ Minimal β Lightweight HAR capture only
βββ mobilesentry_auth_addon.py # π Auth β OAuth/OIDC/token focused capture
βββ DEVICE_SETUP.md # π Device configuration guide
Intercept traffic:
# Start mitmproxy with the full addon
mitmproxy -s mitmproxy_config/mobilesentry_addon.py
# Or headless capture with mitmdump
mitmdump -s mitmproxy_config/mobilesentry_addon.py
# Configure device proxy to <HOST_IP>:8080
# Install CA certificate: open http://mitm.it on device# Analyze a captured HAR file for security issues
mobilesentry traffic analyze capture.harAnalysis checks include:
- HTTPS vs HTTP ratio
- Missing security headers (HSTS, CSP, XFO, etc.)
- Cookie security attributes (Secure, HttpOnly, SameSite)
- Authentication header types (Bearer, Basic, API keys)
- Sensitive data exposure in URLs and response bodies
- TLS version and cipher analysis
- Weak cipher detection (RC4, DES, 3DES, etc.)
# Analyze TLS certificates from captured traffic
mobilesentry traffic certs capture.harCertificate analysis checks:
- Expiry dates and days until expiration
- Self-signed certificate detection
- Wildcard certificate detection
- Deprecated TLS versions (SSLv3, TLSv1.0, TLSv1.1)
- Weak cipher suite detection
- Certificate chain length
mobilesentry apk analyze app.apkmobilesentry apk analyze app.apk --jsonmobilesentry apk info app.apkmobilesentry apk decompile app.apkmobilesentry apk secrets app.apk# Full IPA analysis
mobilesentry ipa analyze app.ipa
# Quick IPA info
mobilesentry ipa info app.ipa
# Extract IPA to .app bundle
mobilesentry ipa decompile app.ipa
# Scan for hardcoded secrets
mobilesentry ipa secrets app.ipaCombine results from multiple analyzers into a single HTML, JSON, or Markdown report.
# Generate an HTML report from an APK analysis JSON file
mobilesentry report --apk ./mobilesentry_output/com.example_analysis.json --format html
# Combine APK + OWASP + obfuscation results
mobilesentry report --apk ./output/com.example_analysis.json --owasp ./output/com.example_owasp.json --obfuscation ./output/com.example_obfuscation.json
# Generate a JSON report (for CI/tooling integration)
mobilesentry report --apk ./result.json --format json
# Generate a Markdown report (for documentation)
mobilesentry report --apk ./result.json --format md --output ./REPORT.mdThe generated HTML report includes:
- Executive summary with risk score (0β100)
- Severity distribution bar chart
- All findings sorted by severity (critical β info)
- Detailed APK metadata section
- Detailed IPA metadata section
- OWASP category breakdown
- Obfuscation detection results
- Dynamic analysis summary
- Traffic analysis overview
- Dark theme, responsive layout, collapsible sections
mobilesentry --help
mobilesentry apk --help
mobilesentry ipa --helpβββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β APK Metadata β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ€
β Package β com.example.app β
β Version β 2.1.0 (42) β
β Min SDK β 26 β
β Target SDK β 34 β
β Size β 12.4 MB β
β Debuggable β β
No β
β Allow Backup β β οΈ Enabled β
β Network Security β β οΈ Missing β
β Signed β β
Yes β
β Signature β APK Signature Scheme v2 β
ββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββ
Permissions are color-coded by severity:
- π΄ DANGEROUS β Sensitive data access (Camera, Location, SMS, etc.)
- π SIGNATURE β System-level permissions
- π΅ UNKNOWN β Custom or undocumented permissions
- β NORMAL β Low-risk permissions (Internet, Network, etc.)
Each issue is displayed in a bordered panel with:
- Severity badge (CRITICAL/HIGH/MEDIUM/LOW)
- Description explaining the vulnerability
- Actionable recommendation
Hardcoded secrets are displayed in a table with severity, type, truncated value, file path, and line number.
mobilesentry/
βββ mobilesentry/
β βββ __init__.py # Package metadata
β βββ __main__.py # Python -m entry point
β βββ cli.py # CLI with argparse + Rich formatting
β βββ apk_analyzer.py # Android APK analysis engine
β βββ ipa_analyzer.py # iOS IPA analysis engine
β βββ static_analyzer.py # OWASP Mobile Top 10 static analysis
β βββ ssl_pinning.py # Frida SSL pinning bypass script generation
β βββ root_bypass.py # Frida root/jailbreak detection bypass script generation
β βββ traffic_intercept.py # MITM proxy setup, HAR analysis, TLS cert analysis
β βββ dynamic_analyzer.py # Runtime monitoring script gen + trace analysis
β βββ obfuscation_detect.py # Code obfuscation detection (ProGuard, OLLVM, packers, etc.)
β βββ config.py # Configuration constants
βββ pyproject.toml # Package config + ruff rules
βββ README.md
βββ LICENSE
APK File
β
βΌ
androguard (APK loading)
β
βββ Parse AXML Manifest βββΊ Package, Version, SDK, Permissions, Components
β
βββ Security Checks βββΊ Debuggable, Backup, Exported Components, Permissions
β
βΌ
apktool (Decompilation)
β
βββ Source Scanning βββΊ 23 regex patterns for hardcoded secrets
β
βΌ
JSON + Rich Terminal Output
IPA File
β
βΌ
unzip (Extraction)
β
βββ Parse Info.plist βββΊ Bundle ID, Version, Min OS, SDK, Permissions
β
βββ Find .app Bundle βββΊ Frameworks, Entitlements, Binary
β
βββ Binary Analysis βββΊ Architectures, PIE, ARC, Stack Canary, Encryption
β
βββ SDK Detection βββΊ 65+ known frameworks matched
β
βββ Security Checks βββΊ ATS, File Sharing, Permissions, Entitlements
β
βββ Source Scanning βββΊ 23 regex patterns for hardcoded secrets
β
βΌ
JSON + Rich Terminal Output
| Check | Description | Severity |
|---|---|---|
| Debuggable App | android:debuggable="true" allows debugger attachment |
π΄ High |
| Backup Enabled | android:allowBackup="true" allows ADB data exfiltration |
π‘ Medium |
| Missing Network Config | No networkSecurityConfig = platform default cleartext policy |
π΅ Low |
| Low minSdkVersion | Targets outdated API levels lacking security features | π‘ Medium |
| Exported Components | Components accessible from other apps without permission | π‘ Medium |
| Excessive Permissions | 10+ dangerous permissions requested | π‘ Medium |
| Sensitive Combos | Camera+Mic, Location+Background, etc. | π΅ Low |
| Check | Description | Severity |
|---|---|---|
| ATS Disabled | NSAllowsArbitraryLoads enables cleartext HTTP |
π΄ High |
| Insecure HTTP Exceptions | Specific domains allowed to load over HTTP | π‘ Medium |
| File Sharing Enabled | UIFileSharingEnabled exposes Documents via USB |
π‘ Medium |
| Missing PIE | Binary not position-independent (ROP vulnerable) | π΄ High |
| Missing ARC | No Automatic Reference Counting (memory bugs) | π‘ Medium |
| Missing Stack Canary | No stack overflow protection | π΄ High |
| Missing Encryption | Binary not FairPlay encrypted (easier to RE) | π‘ Medium |
| Risky Entitlements | Debugger attach, library injection, unsigned exec | π΄ High |
| Excessive Permissions | 5+ high-risk permissions (camera, mic, location, etc.) | π‘ Medium |
MIT License β see LICENSE
Yash Patil β Cybersecurity Analyst | Penetration Tester
- GitHub: @Yash-Patil-1
- LinkedIn: Yash Patil