MOBILE SECURITY
Android APK analysis · iOS security model · Frida instrumentation · SSL unpinning · Drozer · MobSF · ADB · OWASP Mobile Top 10 · Malware analysis · SS7 attacks · Mobile forensics · MVT spyware detection
Mobile Security Fundamentals
- Android uses a Linux UID-per-app sandbox enforced by SELinux; iOS uses hardware-backed Secure Enclave and entitlement-gated sandboxing
- OWASP Mobile Top 10 (2024) replaces the 2016 list - M1 is now Improper Credential Usage rather than Weak Server Side Controls
- MASVS defines two verification levels (L1 standard, L2 defence-in-depth) plus Resilience (R) for anti-tampering requirements
- The mobile threat landscape is dominated by commercial spyware (Pegasus, Predator), banking trojans, and stalkerware targeting domestic abuse victims
- Legal note: accessing a mobile device without explicit written consent violates the CFAA in the US and equivalent laws globally - always get authorisation
Mobile security is one of the fastest-evolving domains in offensive and defensive security. Two platforms dominate: Android (roughly 72% global market share) and iOS. While both are hardened, both are regularly broken. Understanding their security models is the prerequisite for everything that follows in this module.
Think of a market where every trader has their own lockable kibanda. One trader cannot reach over and dip into the next stall's till, and a customer in one stall never sees another's stock. Android does this for apps: each one gets its own locked space, its own user ID, walled off by the system, so a game you installed cannot quietly read your banking app's files. This "sandbox" is the backbone of mobile security — and most serious phone attacks are, at heart, one app finding a crack to climb into another's stall.
► Android Security Model
Android is built on a modified Linux kernel. Its isolation model is deceptively simple: every installed application gets its own Linux user ID (UID). The OS then enforces process isolation at the kernel level - app A literally cannot read app B's files because the filesystem permissions deny access at the UID level. This is called the application sandbox.
| Layer | Component | Security Role |
|---|---|---|
| Linux Kernel | Process management, UID isolation, seccomp filters | Foundation of app sandboxing |
| HAL | Hardware Abstraction Layer | Isolates driver code from Android framework |
| Android Runtime | ART (ahead-of-time compiled DEX bytecode) | Runs app code; isolated per-process |
| Framework | Activity Manager, Package Manager, Binder IPC | Enforces permissions, manages inter-app communication |
| Applications | System apps + third-party APKs | Runs in sandbox, requests permissions |
SELinux (Security-Enhanced Linux) runs in Enforcing mode on all modern Android devices. It implements mandatory access control (MAC) on top of the standard Linux DAC (discretionary access control). Even if an attacker gains a UID, SELinux policy may still block access to sensitive resources. Bypassing SELinux policy is a significant escalation primitive - it's what separates a limited root from a full root.
The Android permission model has evolved significantly. Dangerous permissions (camera, location, contacts) must be requested at runtime since Android 6.0. Users can revoke them individually. However, the permission model only governs what the app can do - it doesn't prevent the app from using those permissions maliciously once granted.
► iOS Security Model
iOS takes a fundamentally different approach. Rather than relying purely on software isolation, Apple's security model is deeply hardware-rooted. The Secure Enclave is a dedicated security processor (present from iPhone 5S onwards) that handles cryptographic operations independently of the main application processor. Biometric data (Face ID, Touch ID templates) never leave the Secure Enclave - not even the OS kernel can access them.
Code signing is mandatory. Every executable that runs on iOS must be signed by an Apple-trusted certificate. The kernel verifies signatures at load time. This prevents unsigned code from executing - a critical control that makes "just run a binary" impossible without either a developer certificate or a kernel exploit (jailbreak). Entitlements are a plist embedded in the signed binary that declare exactly what capabilities the app is allowed to use. Without the entitlement, the API call fails regardless of sandbox state.
| iOS Layer | Components |
|---|---|
| Cocoa Touch | UIKit, Foundation, app frameworks - what developers interact with |
| Media Layer | AVFoundation, Core Graphics, OpenGL - media processing |
| Core Services | Core Data, CFNetwork, Security.framework - system services |
| Core OS | Kernel, file system, networking, Bluetooth, Wi-Fi |
► OWASP Mobile Top 10 (2024)
► MASTG and MASVS
The OWASP Mobile Application Security Testing Guide (MASTG) is the definitive methodology for mobile app security testing. It covers both Android and iOS, structured as test cases mapped to MASVS controls. Think of MASTG as "how to test" and MASVS as "what to test against."
The Mobile Application Security Verification Standard (MASVS) defines three levels: L1 (baseline security, all apps should pass), L2 (defence-in-depth, for apps handling sensitive data like banking or healthcare), and R (Resilience, for apps that need to resist reverse engineering and tampering, like DRM or payment apps).
► Mobile Threat Landscape
Commercial spyware represents the apex of the mobile threat spectrum. Pegasus (NSO Group) and Predator (Cytrox/Intellexa) are zero-click exploit chains that can silently compromise fully patched iPhones and Android devices. They exploit memory corruption vulnerabilities in image parsers, PDF renderers, or network stacks to achieve code execution without any user interaction. Once installed, they exfiltrate messages, calls, location, and can activate mic/camera.
Banking trojans (Cerberus, Anubis, SOVA, SharkBot) target Android because sideloading is possible. They use overlay attacks to steal credentials, abuse Accessibility Services to read screen content, and intercept SMS OTPs. Stalkerware is commercially available spyware marketed for "parental control" or "employee monitoring" but systematically abused in intimate partner violence contexts.
► Mobile Bug Bounty
| Program | Platform | Focus Areas | Notable Payouts |
|---|---|---|---|
| Google VRP | Android, Chrome, Pixel | OS vulnerabilities, app security | Up to $1.5M for full chain |
| Apple Security Bounty | iOS, macOS, iCloud | Kernel, bootchain, iCloud bypass | Up to $2M for zero-click kernel |
| HackerOne programs | Various Android/iOS apps | App-level vulnerabilities | Varies by company |
| Bugcrowd programs | Various Android/iOS apps | OWASP Mobile Top 10 classes | Varies by company |
- Android uses a Linux UID-per-app sandbox enforced by SELinux; iOS uses hardware-backed Secure Enclave and entitlement-gated sandboxing
- OWASP Mobile Top 10 (2024) replaces the 2016 list - M1 is now Improper Credential Usage rather than Weak Server Side Controls
- MASVS defines two verification levels (L1 standard, L2 defence-in-depth) plus Resilience (R) for anti-tampering requirements
- The mobile threat landscape is dominated by commercial spyware (Pegasus, Predator), banking trojans, and stalkerware targeting domestic abuse victims
- Legal note: accessing a mobile device without explicit written consent violates the CFAA in the US and equivalent laws globally - always get authorisation