Detection & Threat Intelligence
Mobile Malware Analysis · Mobile Advanced Security track
10 min read
In this module
From Analysis to Detection
Picking apart a single sample teaches you that one threat in depth. Defending a fleet wants something else — scalable detection that catches malicious activity across thousands or millions of devices without burning an analyst on each one. This lesson covers the tools, techniques, and intelligence frameworks that take what individual analysis turns up and turn it into operational defence.
Network-Based Detection
Network traffic analysis is one of the better ways to catch mobile malware. The win: you don't have to install anything on the device to see what it's doing.
C2 Beacon Patterns
Malware has to phone home to its command-and-control infrastructure. Those calls leave detectable patterns:
- Beaconing: Regular, periodic connections to C2 servers (heartbeats). Statistical analysis of connection intervals reveals beaconing that differs from legitimate app traffic.
- Data exfiltration: Unusual upload volumes, connections to rare destinations, or communication patterns inconsistent with the device's normal baseline.
- Payload retrieval: Downloads from newly registered domains, often containing encrypted configuration data or additional malware modules.
Beacon detection mostly comes down to the gaps between connections. Here's the simplest version, run over three destinations from one phone. Guess which ones get flagged before running it. Then look closely at the hits: mtalk.google.com is Google's own push channel, which heartbeats on a schedule too. That's why real rules pair timing with an allowlist and rarity.
Real tools score each destination on more than one number. Below, the same cdn.img-cache.example implant sits next to a benign notes app, with the coefficient of variation (CV), the median absolute deviation (MAD, a sturdier cousin of the mean absolute deviation in the code above) and a beacon score loosely modelled on RITA's. Drag the jitter up until the implant drops under the threshold, then try the 15-minute interval, where fewer check-ins make it harder to catch. Keep an eye on the app's background sync: it's flagged at the default threshold whatever you do to the implant, and raising the threshold to clear it lets more jittered beacons through.
Spotting a beacon in connection timing
Illustrative data4 hours of synthetic connection logs from one phone, scored per destination. Change the implant's check-in interval and jitter and watch whether the score still catches it.
Implant interval
Benign app log
- Not flagged
api.notes-app.example
Benign app, user activity
Connections over time
Gaps between connections
- Connections
- 64
- Mean gap
- 2.2 min
- Std dev
- 6.2 min
- CV
- 2.82
- Median gap
- 6.0 s
- MAD
- 3.2 s
Beacon score0.33regularity 0.00 · MAD 0.00 · volume 1.00
- Flagged: false positive
sync.notes-app.example
Benign app, background sync
Connections over time
Gaps between connections
- Connections
- 22
- Mean gap
- 10.7 min
- Std dev
- 1.4 min
- CV
- 0.13
- Median gap
- 10.1 min
- MAD
- 17 s
Beacon score0.85regularity 0.73 · MAD 0.89 · volume 0.92
Implant log
- Flagged: beacon-like
cdn.img-cache.example
Implant, C2 check-in
Connections over time
Gaps between connections
- Connections
- 47
- Mean gap
- 5 min
- Std dev
- 0.0 s
- CV
- 0.00
- Median gap
- 5 min
- MAD
- 0.0 s
Beacon score1.00regularity 1.00 · MAD 1.00 · volume 1.00
api.notes-app.example 0.33, not flagged; sync.notes-app.example 0.85, flagged: false positive; cdn.img-cache.example 1.00, flagged: beacon-like
CV is the standard deviation of the gaps divided by their mean: 0 means perfectly regular. MAD is the median absolute deviation from the median gap, which a few odd gaps can't drag around.
Beacon score is the average of regularity (1 − CV ÷ 0.5), MAD (1 − MAD ÷ median ÷ 0.25) and volume (connections ÷ 24, capped at 1), each floored at 0. It's inspired by RITA's beacon analysis, not an implementation of it. The implant adds up to ±0% of the interval to each gap at random. All hosts and traffic are made up.
DNS Anomalies
DNS queries are often the first place compromise becomes visible. The device has to resolve the C2 domain before it can talk to it, and that resolution is loud.
Detection approaches include:
- Known-bad domain blocking: Maintaining lists of domains associated with malware C2 and blocking DNS queries for them.
- DNS anomaly detection: Identifying queries to newly registered domains (NRDs), domains with high-entropy names (algorithmically generated via DGA), or domains resolved at unusual times.
- DNS over HTTPS monitoring: Some malware uses DoH to bypass traditional DNS monitoring. Detecting DoH usage by applications that should not need it is an indicator.
TLS Fingerprinting
HTTPS content might be encrypted, but the handshake metadata is wide open. JA3 and JA4 fingerprinting hash the TLS Client Hello — cipher suites, extensions, elliptic curves, signature algorithms. Those hashes pin down the TLS library and frequently the specific app behind it. Prefer JA4 for new rules: Chrome started shuffling its extension order in 2023, which gives the same browser a different JA3 hash on every connection, and JA4 sorts the extensions before hashing.
Malware that ships its own TLS library or picks weird cipher suites lights up like a Christmas tree. Defenders build detection rules from known-bad hashes or alert on fingerprints that don't match anything legitimate on the network.
Network-based detection works identically for Android and iOS because it operates on network traffic, not on the device. This is particularly valuable for iOS, where endpoint detection is severely limited by Apple's restrictions on background process monitoring. An organisation can deploy DNS filtering and traffic analysis at the network perimeter and gain visibility into potential compromise of all mobile devices, regardless of operating system.
On-Device Detection: Mobile Threat Defence
Mobile Threat Defence (MTD) platforms bundle endpoint and network protection for phones and tablets. They live inside the same sandbox rules as any other app — there's no privileged hook to grab.
MTD Architecture
MTD products stack three detection layers:
- Device-level detection: Identifies OS-level risks such as jailbreaking/rooting, outdated OS versions, insecure configurations, and developer mode.
- Application-level detection: Scans installed applications for known malware signatures, risky permissions, and suspicious patterns. On Android, this includes on-device static analysis. On iOS, it is limited to checking app lists against known-bad databases.
- Network-level detection: Monitors connections for suspicious destinations, MitM attacks, rogue WiFi, and SSL stripping.
MTD Limitations
- iOS restrictions: iOS does not allow one app to inspect another app's code, monitor syscalls, or access the filesystem outside its own sandbox. MTD on iOS is largely limited to network monitoring and configuration checking.
- Sophisticated evasion: State-sponsored spyware operating at kernel level is invisible to any application-layer detection tool.
- Battery and performance: Continuous monitoring consumes battery and data. Users may disable the MTD app if they perceive performance degradation.
MTD does its job against commodity malware and run-of-the-mill network attacks. Don't lean on it alone when the threat actor has resources and patience.
IOCs for Mobile Malware
IOCs (Indicators of Compromise) are what malware analysis ships when it's done — searchable, concrete artefacts that name a particular threat.
IOC Types
| IOC Type | Examples | Detection Method |
|---|---|---|
| Network indicators | C2 domains, IP addresses, URL patterns | DNS monitoring, proxy logs |
| TLS indicators | JA3/JA4 hashes, certificate thumbprints | TLS inspection |
| Application indicators | Package names, certificate hashes, file hashes | MDM inventory, app scanning |
| Behavioural indicators | Permission combinations, API call patterns | MTD, static analysis |
| File indicators | File names, paths, content hashes | Filesystem forensics |
| Process indicators | Process names, parent-child relationships | Shutdown logs, diagnostic dumps |
MVT: Mobile Verification Toolkit
Amnesty International's MVT earns its own section. It's a forensic detection tool built to flag the fingerprints of commercial spyware.
MVT Architecture
MVT is a Python command-line tool that chews on mobile device data offline. Nothing runs on the phone — the analyst extracts data first, then MVT processes it on a workstation.
For iOS, MVT looks at iTunes/Finder backups and full filesystem dumps. For Android, it digs through ADB backups, installed APKs, and bugreport diagnostic dumps.
IOC Matching
MVT runs the extracted data against STIX2-formatted indicators that Amnesty International maintains. Those indicators cover C2 domains, process names, file paths, and message patterns tied to Pegasus and friends.
Analysis Modules
MVT includes specialised modules:
- SMS database analysis: Checks for messages containing known exploitation links.
- Safari history: Identifies visits to exploitation domains.
- Timeline generation: Chronological reconstruction of device events to identify the compromise moment.
- Network usage databases: Analyses
DataUsage.sqliteandnetusage.sqlitefor connections by suspicious processes. - Shutdown log analysis: iOS records process information during shutdowns. Spyware processes appear here even when hidden from standard listings.
MVT fills a critical gap in mobile security. Commercial antivirus and MTD cannot detect state-sponsored spyware at kernel level. MVT takes a forensic approach: rather than real-time on-device detection, it analyses artefacts in databases, logs, and filesystem metadata. This works because even sophisticated spyware leaves traces in system databases recording process execution, network connections, and file access - traces the spyware cannot easily suppress without breaking the OS's own functionality.
Threat Intelligence Feeds
VirusTotal
VirusTotal stitches together results from 70+ antivirus engines and exposes an API for automated IOC lookups. For mobile, you get APK analysis, detection ratios, known C2 domains, and behavioural reports. VirusTotal Intelligence lets you pivot across millions of samples by package name, certificate hash, permission set, whatever you need.
MalwareBazaar
MalwareBazaar (abuse.ch) is a community sample-sharing project. It accepts mobile malware and redistributes it tagged with family names, IOCs, and YARA rules. Researchers upload, defenders pull samples down to study and build signatures from.
MITRE ATT&CK Mobile
MITRE ATT&CK for Mobile is a structured taxonomy for mobile threat techniques. Tactics describe the adversary's goal; techniques describe the method. The mobile-specific tactics worth knowing:
- Initial Access: How malware reaches the device (supply chain, phishing, zero-click exploit).
- Persistence: How it maintains access (boot receiver, accessibility service, OS implant).
- Collection: What data it gathers (calls, SMS, location, camera, clipboard).
- Exfiltration: How data reaches the attacker (HTTPS, DNS tunnelling).
- Defence Evasion: How it avoids detection (obfuscation, emulator detection, delayed execution).
Responsible Disclosure for Mobile
Mobile vulnerability disclosure pulls in platform vendors (Apple, Google), device OEMs, and the wider research community.
- Coordinated disclosure: Researchers report vulnerabilities to the vendor before publication, allowing time for patching. Apple and Google both maintain vulnerability reward programmes.
- Embargo periods: Commonly 90 days, the deadline Google Project Zero made a de facto norm, though other teams and programmes set their own (CERT/CC uses 45 days, for example) and extensions get negotiated. The vendor has this window to release a patch before the researcher publishes details.
- Emergency patches: For actively exploited zero-days (like BLASTPASS), Apple can release emergency updates within days.
- Publication: After patching, detailed technical write-ups help the community understand the vulnerability class and develop broader defences.
Effective mobile threat intelligence follows a continuous cycle: analyse samples to extract IOCs, format them for machine consumption (STIX2), deploy to detection infrastructure (DNS, IDS, MTD), share with the community (MISP), and feed detection results back for refinement. The goal is to transform expensive individual analysis into scalable automated detection. No single tool or technique suffices - value comes from integrating multiple sources and methods into a coherent programme.