
I uncover the stealthy world of commercial spyware on iOS, explaining its evolution, detection tactics, forensic tools, and how to protect your devices.
Detecting Commercial Spyware on iOS: Tactics & Unseen Threats
Published by Brav
Table of Contents
TL;DR
- Commercial spyware on iOS has evolved from SMS links to zero-click iMessage attacks, leaving subtle traces in device logs. Pegasus — Wikipedia (2023)
- Detection relies on a triad of tools: MDM for app inventory, SysDiagnose for device diagnostics, and backup-analysis tools like MBT to surface remnants. Apple — SysDiagnose (2022) Amnesty International — MBT Backup Analysis Tool (2023)
- A full device wipe removes the spyware, but restoring from a compromised backup re-installs it. Citizen Lab — Pegasus 2021 Analysis (2021)
- The industry still lacks shared IOCs and automated detection, making manual forensic analysis the only reliable method.
Why this matters
I’ve spent the last decade hunting stealthy actors on iOS. The hardest thing? Spotting an invisible thief that can exfiltrate data without ever asking the user to tap a link. Every new version of iOS feels like a patchwork of zero-day fixes, but the attackers keep one step ahead by evolving their delivery mechanisms. If you’re a SOC analyst, forensic examiner, or a security engineer, missing a single trace can mean a target’s entire communications and biometrics are in the wrong hands. Apple patched the Blast Pass vulnerability in iOS 16, closing a major zero-day vector iOS 16 — Wikipedia (2023).
Core concepts
Commercial spyware isn’t a one-size-fits-all program. Think of it as a sophisticated, purpose-built malware sold to state-actors. The core differences from jailbreaks are:
| Feature | Commercial Spyware | Jailbreak |
|---|---|---|
| User interaction | Zero-click or one-click | Explicit user action |
| Persistence | Often removed by cleanup routines | Leaves the system open |
| Visibility | Designed to evade forensic tools | Leaves obvious traces |
The most notorious examples are Pegasus, Hermit, and the recently uncovered Predator 2.0 (re-written in Objective-C to sidestep static analysis). Each has a distinct delivery vector:
| Spyware | Infection Vector | Persistence | Detection Difficulty |
|---|---|---|---|
| Pegasus 2016 | SMS link | Medium (cleanup leaves logs) | Medium |
| Pegasus 2021 | iMessage zero-click | High (shutdown lock traces) | High |
| Hermit | App install via malicious download | Medium (remains in App Store) | Low |
| Predator 2.0 | Zero-click, sandbox escape | High (persistent payload) | Very High |
| iSoon | End-click SMS, no persistence | Low | Low |
Pegasus 2016 was the first publicly released sample that demonstrated the feasibility of a state-sponsored zero-click attack on iOS, using a malicious SMS link to exploit a WebKit vulnerability and install a covert payload Pegasus — Wikipedia (2023). Pegasus 2021 shifted tactics, using iMessage attachments that never require user interaction, leaving cleanup artifacts in the shutdown lock after the OS is rebooted Pegasus — Wikipedia (2023). The Hermit family, detailed in a 2022 Citizen Lab study, leveraged a compromised app that masqueraded as a benign utility, making it easy to detect through standard MDM inventory Hermit — Wikipedia (2023).
How does it hide?
Most commercial spyware relies on a two-stage approach:
- Delivery – A zero-day in WebKit or a misconfigured app triggers the payload.
- Execution – The malware runs in a sandbox, escalates privileges, and writes a command-and-control (C&C) channel through the device’s cellular or Wi-Fi connection.
Because the malware can delete its crash logs, clear its attachment history, and mimic legitimate system processes, conventional antivirus or anti-spyware solutions rarely flag it. The only reliable method is to compare a pristine backup with a suspect one, or to run a full forensic imaging of the device.
How to apply it
Below is a practical workflow I use in the field. It combines manual and automated steps and is tuned for teams that have limited budget and need quick turnaround.
| Step | Action | Tool | Expected Result |
|---|---|---|---|
| 1 | Validate iOS version | Check Settings > General > About | Ensure device is running latest security patch. |
| 2 | MDM app inventory | MDM console | Flag any app not listed in the company catalog; flag Hermit or other suspicious third-party apps. Apple — Mobile Device Management (MDM) (2023) |
| 3 | Run SysDiagnose | SysDiagnose (Apple) | Pull crash logs, attachment database, and diagnostic bundles. |
| 4 | Backup analysis | MBT or custom scripts | Compare backup metadata with device snapshots for orphaned files or unexpected binaries. |
| 5 | Manual forensic | SQLite editor, Xcode Instruments | Inspect iMessage attachment tables for anomalies; look for hidden data in the device’s local storage. |
| 6 | Full wipe & restore | iTunes or Finder | After confirming presence of spyware, erase all content and settings. |
| 7 | Re-injection check | Restore from a known clean backup | Verify that no spyware files reappear after the restore. |
A deeper dive into SysDiagnose
Apple’s SysDiagnose is a command-line tool that dumps diagnostic logs, system state, and crash reports. It’s lightweight (10–15 min) and runs on macOS without root access Apple — SysDiagnose (2022). Key logs to parse include:
- /var/log/diagnostics – system crash dumps
- /private/var/mobile/Library/MessageAttachments – iMessage data
- /private/var/mobile/Library/Preferences – app preferences, sometimes used to store API tokens
When a spyware like Pegasus 2021 runs, it writes a small “cleanup” script that deletes its own crash logs but leaves a timestamped file in /Library/Apple/Kernel/—a footprint that can be spotted with a simple grep.
Leveraging MBT
MBT (Mobile Backup Toolkit) is a free, open-source framework from Amnesty International that parses iOS backups and generates a JSON summary of file system trees, crash logs, and database snapshots Amnesty International — MBT Backup Analysis Tool (2023). Run MBT on both the clean and suspect backups and look for:
- Orphaned binaries – files in /private/var/mobile/Library/Caches that aren’t present on the device.
- Suspicious entries – any com.apple plist that references a third-party bundle identifier.
- Deleted entries – records of files that were present in a prior backup but are missing now, suggesting a deliberate removal.
A simple diff script (diff -rq clean.backup/ suspect.backup/) will surface most anomalies in minutes.
Pitfalls & edge cases
Even with this workflow, I’ve run into a handful of gray areas:
- Zero-click persistence – Some spyware can remain dormant in the background until the device is rebooted, making detection a race against time.
- Backup reinfection – If the backup itself was compromised, a wipe will not help; you’ll end up restoring the same payload Citizen Lab — Pegasus 2021 Analysis (2021).
- MDM blind spots – MDM can’t detect spyware that hides behind system extensions or in the iOS kernel; it only sees the app bundle identifiers.
- False positives – Legitimate security tools (e.g., mobile antivirus apps) can leave behind large cache files that look like spyware remnants.
- Legal & privacy – Forensic analysis can expose personal data that must be handled under GDPR or local privacy laws. Be sure to keep a chain of custody and only analyze data that’s necessary.
Because of these challenges, the industry still lacks a universally adopted IOC feed. Collaboration between academia, civil society, and commercial vendors is essential to keep the detection ecosystem up-to-date.
Quick FAQ
| Q | A |
|---|---|
| Can I detect spyware without forensic tools? | Rarely; most spyware is designed to stay invisible. |
| Is there an automated detection framework? | No, current solutions rely on manual analysis. |
| How does MDM help? | It flags unapproved apps like Hermit that can be blocked at the fleet level. |
| Can a full device wipe remove spyware? | Yes, but only if the backup is clean; otherwise the spyware will be restored. |
| Does Apple patch spyware? | Apple patches underlying vulnerabilities, but detection remains the onus of the user and security professionals. |
| Are there public IOCs? | Very few; most organizations keep them internal. |
Conclusion
The fight against commercial spyware on iOS is a high-stakes cat-and-mouse game. With each new iOS version, attackers find a fresh zero-day and a new delivery vector. For the mobile security professionals, the practical takeaway is to combine MDM inventory, SysDiagnose diagnostics, and backup analysis with a disciplined wipe-restore process. Keep the device’s firmware up to date, but don’t rely on that alone. The next step? Start sharing your findings with peers, publish IOCs in a secure, vetted channel, and push for an industry-wide spyware detection standard.
