Adversary-in-the-Middle (T1638) is an adversary placing itself between a mobile device and the services it talks to, so it can read, redirect or alter the traffic. On a phone that position can be gained on the device, by a malicious app registered as a VPN or a rogue trusted certificate, or off the device, through a rogue Wi-Fi access point or cellular base station. MITRE ATT&CK v20 lists T1638 under Collection for Android and iOS. This guide is for mobile security engineers, app developers and SOC analysts: the interception paths ATT&CK describes, the OS and app controls that close them, and how ATT&CK's v20 analytics detect them. For the matrix overview see the MITRE ATT&CK for Mobile Guide; for the Enterprise technique see MITRE ATT&CK T1557 Adversary-in-the-Middle.
Key takeaways
- Properly encrypted traffic is the main defence. ATT&CK states that correctly implemented Apple App Transport Security and Android Network Security Configuration may prevent sensitive data leaks, depending on the point of capture.
- VPN registration needs consent on both platforms. ATT&CK notes the user must consent on Android and iOS, and iOS also needs an Apple-granted entitlement.
- Trust stores are the quiet path. ATT&CK records Monokle installing attacker-specified certificates into the trusted store; MDM inventory of profiles and certificates is how you spot it.
- Android adds adversary-in-the-disk. ATT&CK describes apps abusing shared external storage to read or replace files other apps exchange through it.
- Two mitigations are mapped. M1009 Encrypt Network Traffic and M1006 Use Recent OS Version; the rest is MDM policy and app engineering.
What T1638 covers
ATT&CK has revoked several older mobile techniques into T1638, including rogue Wi-Fi access points, rogue cellular base stations, downgrade to insecure protocols and network traffic capture or redirection. The current technique describes these interception paths:
| Path | Where it happens | Platform notes (per ATT&CK and vendor docs) | Primary control |
|---|---|---|---|
| Malicious app registered as a VPN | On device | Android: user consent through VpnService.prepare(), key icon in the status bar while active. iOS: user consent plus an Apple-granted entitlement | App allow list; managed always-on or per-app VPN; MDM inventory of VPN apps |
| Rogue trusted certificate | On device | Android apps targeting API 24 or later trust only system CAs by default. iOS: a manually installed root is not trusted for TLS until the user enables full trust in Certificate Trust Settings | Block user profile installs on managed devices; inventory certificates |
| App with escalated privileges | On device | ATT&CK: privileges used to reach network traffic; KeyRaider hooked SSL functions in an iOS system process | Integrity checks for root and jailbreak; OS updates |
| Adversary-in-the-disk | On device, Android only | Abuse of shared external storage access (READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE) to read or tamper with exchanged files | Apps store sensitive files in app-private storage and verify what they load |
| Rogue Wi-Fi or cellular base station | Off device | Captures traffic after it leaves the device | TLS with correct validation; Lockdown Mode on iPhone disables 2G and 3G |
| Local network attacks | Off device | ATT&CK points to Enterprise ARP Cache Poisoning (T1557.002) and DHCP Spoofing (T1557.003) | Network controls; TLS |
The position is usually a means, not an end. ATT&CK names follow-on behaviours such as Transmitted Data Manipulation (T1565.002) and Endpoint Denial of Service (T1642).
Procedure examples
| Software (ATT&CK v20) | What ATT&CK records | Defensive lesson |
|---|---|---|
| KeyRaider (S0288) | Most samples hook SSLRead and SSLWrite in the itunesstored process to intercept communication with the App Store | On a jailbroken iOS device, TLS can be read before encryption; integrity checks come first |
| Monokle (S0407) | Can install attacker-specified certificates into the device's trusted certificate store | Monitor the certificate and profile inventory, and pin certificates in your own apps |
| S.O.V.A. (S1062) | Has included adversary-in-the-middle capabilities | Banking malware treats interception as one more way to take credentials |
Platform controls on Android and iOS
Android
- Network Security Configuration: a declarative XML file referenced from the manifest. Apps targeting API 24 or later trust only pre-installed system CAs by default; apps targeting API 23 or lower also trust user-added CAs. Apps targeting API 28 or later block cleartext by default. Pins use SHA-256 hashes of the SubjectPublicKeyInfo; Google advises always including a backup pin.
debug-overridesapply only to debuggable builds. - VPN: an app becomes the VPN only after the user approves the system dialog from
VpnService.prepare(). Only one VPN is active per user or profile, and starting one stops the other. Settings, Network and internet, VPN lists the apps the user has accepted. Always-on VPN is available from Android 7.0, and "Block connections without VPN" forces all traffic through the tunnel.
iOS
- Certificate trust: a certificate in a profile installed manually, by email or download, is not automatically trusted for TLS; the user must turn on trust in Settings, General, About, Certificate Trust Settings. Certificates installed through MDM or Apple Configurator are trusted automatically, so the MDM profile inventory is the authoritative list.
- VPN: ATT&CK notes VPN registration requires user consent and an Apple-granted entitlement; its iOS analytic keeps an approved list of VPN apps with the Network Extension entitlement.
- App Transport Security: ATT&CK names ATS as the iOS control that, implemented properly, may stop sensitive data being exposed to an interceptor. Review exceptions declared under
NSAppTransportSecurityin apps you build. - Lockdown Mode: for high-risk users, Apple states it stops auto-joining non-secure Wi-Fi, turns off 2G and 3G cellular support, blocks installing configuration profiles, and requires the device to be unlocked to connect to accessories. It also prevents enrolling in MDM, though devices enrolled before it was turned on stay managed. See the Apple Lockdown Mode Guide.
Detection: ATT&CK v20 analytics
ATT&CK v20 detection strategy DET0623 has two analytics. Both follow ATT&CK's rule: alert on a state change inconsistent with the baseline or approved management policy, and do not infer unobserved activity from management state alone.
| Analytic | Platform | Data sources | Tunable fields |
|---|---|---|---|
| AN1687 | Android | File writes to /sdcard/ from app vetting or forensic acquisition; proxy or gateway DNS and HTTP(S) inspection; DPC policy, compliance and security state, and SecurityLog events where supported | ApprovedVPNApps (IT-managed VPN packages); HighValueAppList (banking, payment and enterprise apps writing to external storage) |
| AN1688 | iOS | Entitlements and Info.plist keys from app vetting; proxy or gateway inspection; MDM DeviceInformation, SecurityInfo, ProfileList and restrictions queries | ApprovedVPNApps (iOS VPN bundle IDs with the Network Extension entitlement) |
In practice the high-value signals are state changes: a new VPN app or configuration not on the approved list, a new certificate or profile in the MDM ProfileList, a device failing integrity checks, or traffic from a managed device no longer reaching the corporate gateway. For apps you build, certificate validation failures reported from the field can point at interception on a network.
Metrics that show it is working
- Unapproved VPN apps: managed devices with a VPN app outside
ApprovedVPNApps; target zero. - Unexpected trust anchors: devices with a certificate or profile not deployed by MDM.
- Cleartext exceptions: in-house apps with
cleartextTrafficPermitted="true"or broad ATS exceptions, trended per release. - Pinning coverage: share of in-house apps that pin their own API endpoints with a backup pin.
- Integrity failures: rooted or jailbroken devices detected, and time to quarantine.
Prevention and response
- Encrypt and validate in your own apps (M1009). Keep platform defaults: no cleartext, system trust anchors only. Pin your own API endpoints with a backup pin, test pin rotation before release, and verify against OWASP MASVS-NETWORK. See the Certificate Pinning guide.
- Keep the OS current (M1006). ATT&CK notes recent OS versions make registering as a VPN provider harder. Enforce a minimum OS version in MDM compliance.
- Own the VPN slot. Deploy the corporate VPN as always-on (Android) or per-app VPN (iOS) through MDM, so a malicious app cannot take the slot unnoticed, and alert on any other VPN app.
- Restrict trust store changes. Block user installation of configuration profiles on supervised iOS devices and keep user CA trust out of managed Android apps. Inventory certificates weekly.
- Protect high-risk staff. Offer Lockdown Mode on iPhone and the Android Advanced Protection mode on Android; see the Mobile Communications Protection for High-Risk Individuals Guide.
- Respond: on an unapproved VPN or certificate, isolate the device from corporate resources, collect the profile list and app inventory, remove the component, and revoke sessions used on the device.
Pilot pinning and VPN changes on a test ring: a wrong pin breaks the app for every user until an update ships, which is why Google advises the backup pin.
Where identity fits
An interceptor's prize is usually a credential: session cookies, OAuth bearer tokens, API keys embedded in app traffic. Pinning protects the transport, but tokens should also be short-lived and, where the platform allows, bound to the device so a captured token is less useful elsewhere. See the Secrets in Mobile Apps guide and the Mobile Access Credentials guide.
Common failure patterns
- Debug trust shipping to production. Custom trust code instead of
debug-overridescan leave a release build trusting a test CA. - Pinning without a backup pin. A key rotation becomes an outage, and teams then turn pinning off.
- Broad cleartext or ATS exceptions. A legacy domain exception widened to the whole app removes the protection ATT&CK relies on.
- No inventory of VPN apps and profiles. The two most direct on-device paths go unseen.
- Sensitive files on shared storage. On Android, files exchanged through external storage can be read or swapped by another app.
Framework mapping
| Framework | Reference | Why it applies |
|---|---|---|
| ATT&CK for Mobile | M1009 Encrypt Network Traffic; M1006 Use Recent OS Version | Mitigations mapped to T1638 |
| ATT&CK Enterprise | T1557 Adversary-in-the-Middle | Enterprise equivalent, including network-side variants |
| NIST SP 800-53 Rev. 5 | SC-8 Transmission Confidentiality and Integrity; SC-17 Public Key Infrastructure Certificates; SI-4 System Monitoring | Protect data in transit, control trusted certificates, monitor for change |
| NIST CSF 2.0 | PR.DS-02; DE.CM-01 | Protect data in transit; monitor networks |
| OWASP MASVS | MASVS-NETWORK | Secure network communication and pinning in apps you build |
Practitioner checklist
- Keep an approved list of VPN apps and alert on any other.
- Deploy the corporate VPN as always-on or per-app through MDM.
- Inventory certificates and configuration profiles on every managed device weekly.
- Block user installation of profiles on supervised iOS devices.
- Ship in-house apps with no cleartext, system trust anchors only and pinned endpoints with a backup pin.
- Review ATS and Network Security Configuration exceptions at every release.
- Keep sensitive files in app-private storage on Android.
- Offer Lockdown Mode or equivalent protection to high-risk staff.
Standards and references
- MITRE ATT&CK: Adversary-in-the-Middle (T1638)
- Android Developers: Network security configuration
- Android Developers: VPN
- Apple: Trust manually installed certificate profiles in iOS, iPadOS and visionOS
- Apple: About Lockdown Mode
- OWASP: Mobile Application Security Verification Standard
- NIST: SP 800-53 Rev. 5
Related NHI Mgmt Group resources: MITRE ATT&CK for Mobile Guide · MITRE ATT&CK T1557 Adversary-in-the-Middle · Certificate Pinning · OWASP Mobile Top 10 M5 Insecure Communication Guide · Mobile Device Management Security Guide