GHOSTNET›MOD-13 // MOBILE SECURITY
CONCEPTLAB →
MODULE 13 · CONCEPT PAGE

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

← MOD-12: WIRELESS ATTACKSMOD-13 of 13
9
CHAPTERS
~3.0hr
TOTAL READ
ADVANCED
DIFFICULTY
MOD-13
IDENTIFIER
BEGINNER~14 min READCHAPTER 1 OF 9

Mobile Security Fundamentals

KEY POINTS · THE QUICK VERSION
  • 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
Scan these first, then read below for the depth and examples — or jump straight to the lab.

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.

◈ PICTURE IT — MTAANI EDITION

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.

LayerComponentSecurity Role
Linux KernelProcess management, UID isolation, seccomp filtersFoundation of app sandboxing
HALHardware Abstraction LayerIsolates driver code from Android framework
Android RuntimeART (ahead-of-time compiled DEX bytecode)Runs app code; isolated per-process
FrameworkActivity Manager, Package Manager, Binder IPCEnforces permissions, manages inter-app communication
ApplicationsSystem apps + third-party APKsRuns 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 LayerComponents
Cocoa TouchUIKit, Foundation, app frameworks - what developers interact with
Media LayerAVFoundation, Core Graphics, OpenGL - media processing
Core ServicesCore Data, CFNetwork, Security.framework - system services
Core OSKernel, file system, networking, Bluetooth, Wi-Fi

► OWASP Mobile Top 10 (2024)

👁 WATCH THIS · you don't need to run it yet — just read along
// OWASP MOBILE TOP 10 — 2024 EDITION
M1  Improper Credential Usage
    Hardcoded credentials, insecure storage, weak key management
    Example: API key in strings.xml or hardcoded in APK assets

M2  Inadequate Supply Chain Security
    Malicious third-party SDKs, vulnerable dependencies, poisoned build pipeline
    Example: Xcode Ghost campaign infected iOS builds via malicious Xcode copy

M3  Insecure Authentication / Authorization
    Broken auth logic, missing token validation, improper session management
    Example: JWT accepted without signature verification on mobile backend

M4  Insufficient Input/Output Validation
    SQL injection in content providers, XSS in WebView, intent injection
    Example: content://PROVIDER_URI?id=1 OR 1=1-- returns all records

M5  Insecure Communication
    Cleartext HTTP, weak TLS config, missing certificate pinning
    Example: NetworkSecurityConfig allows cleartext for all domains

M6  Inadequate Privacy Controls
    Over-collection of PII, insecure data sharing, analytics SDK leakage
    Example: third-party analytics SDK exfiltrates IMEI, GPS, contacts

M7  Insufficient Binary Protections
    No obfuscation, missing anti-tampering, no root/jailbreak detection
    Example: credentials extracted in 30s because ProGuard disabled

M8  Security Misconfiguration
    Debuggable flag, exported components, backup flag, test endpoints
    Example: android:debuggable="true" in production release

M9  Insecure Data Storage
    World-readable SharedPreferences, cleartext SQLite, external storage
    Example: /sdcard/myapp/tokens.txt readable by any app (pre-Android 10)

M10 Insufficient Cryptography
    Custom crypto, ECB mode, weak keys, reuse of IVs, MD5 for passwords
    Example: AES-ECB used for user data - same plaintext = same ciphertext
What you're seeing: The ten most common ways mobile apps are broken, as agreed by the OWASP community. Do not try to memorise the list — just skim it as a map of where things go wrong: secrets left in the app, weak logins, data stored in the clear, sloppy crypto. Each one becomes a hands-on skill later in this module.
↪ Nothing to run — treat this as the table of contents for everything that follows.

► 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

ProgramPlatformFocus AreasNotable Payouts
Google VRPAndroid, Chrome, PixelOS vulnerabilities, app securityUp to $1.5M for full chain
Apple Security BountyiOS, macOS, iCloudKernel, bootchain, iCloud bypassUp to $2M for zero-click kernel
HackerOne programsVarious Android/iOS appsApp-level vulnerabilitiesVaries by company
Bugcrowd programsVarious Android/iOS appsOWASP Mobile Top 10 classesVaries by company
CRITICAL
Legal note: accessing another person's mobile device - even to test an app - without explicit written consent is a criminal offence in virtually every jurisdiction. In the US this triggers the Computer Fraud and Abuse Act (CFAA). Always have a signed scope agreement, test only on devices and accounts you own or have explicit permission to test.
RECAP · CHECK YOURSELF
  • 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
Read to the end to count this chapter
▸ READY TO PRACTISE
You've now covered enough for Lab steps 1–2 of 18. Try them in the lab while it's fresh.
OPEN LAB ▸
⚡ TEST YOURSELF
End-of-chapter quiz
A dozen questions — recall and practical. Graded, earns up to 20 XP.
PRACTISE IN THE LAB ▸
READY TO PRACTICE?
MOD-13 Interactive Lab
18 steps · 435 XP · Real commands · Flag captures
LAUNCH LAB →
← MOD-12: WIRELESS ATTACKS