Skip to main content
Be Bitwise

iOS Malware & Spyware Analysis

Mobile Malware Analysis · Mobile Advanced Security track

10 min read

In this module

iOS Malware: A Different Threat Model

iOS malware lives in a different world from its Android cousin, both in volume and in calibre. Apple's closed ecosystem — mandatory App Store distribution, aggressive code review, strict sandboxing, fast update delivery — keeps commodity malware vanishingly rare. What does break in is overwhelmingly state-sponsored or commercially developed spyware that burns zero-days to walk straight past the platform's defences.

So iOS analysis is less about churning through samples and more about forensic investigation of small numbers of very expensive, very targeted attacks.

The NSO Group Pegasus Platform

Pegasus, built by Israeli surveillance company NSO Group, is the most extensively documented commercial spyware platform on the planet. It's the state of the art in mobile exploitation: zero-click delivery, full device compromise, and exfiltration of, frankly, everything.

Pegasus Capabilities

Once installed, Pegasus hands the operator a master key:

  • Messaging: Reads everything — iMessage, WhatsApp, Signal, Telegram. End-to-end encryption is no help, because Pegasus is reading after decryption on the endpoint.
  • Calls: Phone and VoIP, recorded.
  • Location: Continuous GPS.
  • Camera and microphone: Remote activation for live surveillance.
  • Passwords: Pulls stored credentials out of the keychain.
  • Files: Access to every file on the device — photos, documents, the lot.

The thing to internalise: Pegasus owns the endpoint. Transport encryption and end-to-end encryption don't matter when the spyware is reading the plaintext after the device decrypts it.

Zero-Click Exploit Chains

Pegasus arrives via exploit chains — sequences of vulnerabilities that climb from an entry point all the way to full device compromise. Watching these chains evolve over time gives you both the inventiveness of exploit developers and the defensive ladder Apple has been climbing in response.

FORCEDENTRY (CVE-2021-30860)

FORCEDENTRY is one of the most jaw-dropping exploits ever publicly documented. Citizen Lab found it. Project Zero pulled it apart. The target was the JBIG2 image decoder in CoreGraphics.

Delivery: A crafted PDF, sent over iMessage. The recipient didn't have to open it. iMessage rendered the attachment for preview automatically, and that was enough.

The exploit mechanism: JBIG2 is a lossless image compression format with logical operations (AND, OR, XOR, XNOR) on bitmap segments. An integer overflow in the decoder led to a heap overflow that wiped out the page bitmap's bounds, so ordinary JBIG2 segment commands could then read and write memory far outside the image.

Then it got weird. The exploit used those bitmap logical operations to construct a Turing-complete virtual computer inside the decoder itself. Over 70,000 segment commands built registers (as bitmap regions), a 64-bit adder (out of logical operations on bitmap segments), a comparator, and memory-search routines. The virtual CPU then bootstrapped further exploitation — no traditional shellcode, no JIT.

Sandbox escape: iMessage attachments are meant to be processed inside BlastDoor, a sandbox Apple added in iOS 14 specifically to contain message-parsing exploits. FORCEDENTRY went around it. The PDF carried a .gif extension and was handed to IMTranscoderAgent, which parsed it outside BlastDoor, and Project Zero's follow-up analysis showed a second-stage logic bug (abusing NSPredicate evaluation) that escaped IMTranscoderAgent's own sandbox.

Step through the chain below. On the weird machine stage, flip the three inputs and run the eleven commands one by one: you're building a full adder out of nothing but AND, OR, XOR and XNOR, the same raw material the exploit had.

FORCEDENTRY, stage by stage

CVE-2021-30860, the zero-click iMessage exploit Project Zero took apart in 2021 and 2022. Concepts only, no exploit code.

The attachment's name ended in .gif, but the file was a PDF. Nobody had to tap anything.

  1. iMessage attachment named *.gif

    Most untrusted message content is parsed inside BlastDoor, the sandbox added in iOS 14.

  2. IMTranscoderAgent, outside BlastDoor

    A GIF-copying routine in IMTranscoderAgent picked up the file, trusting the extension.

  3. ImageIO sniffs the real format

    ImageIO decides the format from the bytes, not the name, so it handed the file on as a PDF.

  4. CoreGraphics PDF parser

    The PDF contained a JBIG2 stream, so CoreGraphics ran its JBIG2 decoder, which comes from Xpdf.

  5. JBIG2 decoder

    JBIG2 is a compression format for black-and-white scans. Its decoder held the bug.

Sources: Project Zero, Beer and Groß, December 2021; Project Zero, Beer and Groß, March 2022
Why FORCEDENTRY Matters

FORCEDENTRY proves any sufficiently complex data parser can become an exploitation target. JBIG2 was not on anyone's high-risk list — it's a niche format mostly used in document scanning. Its support for logical operations on bitmaps was enough for an attacker to build a virtual machine inside the decoder. The lesson for attack surface reduction is brutal: every format parser and codec that touches untrusted input is a potential vector, no matter how obscure the format looks on paper.

PWNYOURHOME (2022)

Once Apple patched FORCEDENTRY and stiffened BlastDoor, NSO went hunting for less-fortified ground.

PWNYOURHOME targeted the HomeKit daemon. A zero-click iMessage trigger fired a bug in the HomeKit framework handling certain iMessage payloads related to smart-home device sharing. The HomeKit daemon runs with elevated privileges outside BlastDoor, opening a direct path into wider system access.

It's a textbook example of the attacker's strategy: when one component gets patched and sandboxed, drift towards whatever's left less defended.

BLASTPASS (CVE-2023-41064)

Citizen Lab caught BLASTPASS in September 2023 — another zero-click iMessage chain hitting code execution through image processing.

Delivery: PassKit attachments (Apple Wallet passes) carrying a crafted image. iMessage processed the attachment and triggered a buffer overflow in ImageIO's WebP handling (CVE-2023-41064).

Apple patched it within days in iOS 16.6.1, alongside a Wallet validation bug, CVE-2023-41061, that the chain also used. The ImageIO bug turned out to share its root cause with libwebp's CVE-2023-4863, which hit Chrome and every other app bundling libwebp that same month.

Lockdown Mode: Apple's Response

Apple's answer to mercenary spyware shipped in iOS 16 as Lockdown Mode. Rather than playing whack-a-mole with individual vulnerabilities, Lockdown Mode takes the proactive route: lop off the attack surface.

What Lockdown Mode Disables

  • iMessage attachments: Most attachment types are blocked outright. Certain images, video and audio still get through; the rest is dropped before any parser sees it.
  • Link previews: Off. No more processing of attacker-controlled content for message previews.
  • JIT compilation in Safari: WebKit's JavaScript JIT is switched off, which kills an entire class of browser exploit technique.
  • USB data connections: When the device is locked, USB data transfer is blocked, neutering forensic extraction tools.
  • Configuration profiles: Installation of MDM profiles is blocked.

It's aimed at users with a target on their back: journalists, human-rights defenders, activists, diplomats. Citizen Lab confirmed it would have blocked the BLASTPASS chain.

Key Concept
Attack Surface Reduction vs Vulnerability Patching

Lockdown Mode is a paradigm shift from reactive vulnerability patching to proactive attack-surface reduction. Instead of hunting and fixing individual bugs in message parsers and media codecs, Lockdown Mode just disables the parsers. That removes whole categories of future, undiscovered vulnerabilities in one swing. The trade-off is functionality — which is why it's aimed at high-risk users only. The principle it bakes in is one the security community has been quietly believing for years: the most secure code is the code that doesn't run.

Other iOS Spyware Campaigns

The same story as dates, with Triangulation from the next section slotted in. Notice how short the gap between disclosure and patch gets once Apple has the sample:

Zero-click chains and Apple's responses

Total: 3 years

Patch
Disclosure
Other
  1. BlastDoor ships(Other)

    iOS 14 moves parsing of untrusted iMessage content into a tightly sandboxed service.

    +12 months
  2. FORCEDENTRY disclosed(Disclosure)

    Citizen Lab publishes the JBIG2 chain. iOS 14.8 fixes CVE-2021-30860 the same day.

    +12 months
  3. Lockdown Mode ships(Other)

    iOS 16 adds an opt-in mode for high-risk users that switches off most message attachment types, link previews and other attack surface.

    +7 months
  4. PWNYOURHOME reported(Disclosure)

    Citizen Lab describes the HomeKit-based chain used during 2022 against iOS 15 and 16. On phones in Lockdown Mode it appears to have been blocked, and targets saw warnings about it.

    +44 days
  5. Triangulation disclosed(Disclosure)

    Kaspersky reports the four-zero-day chain found on its own staff's iPhones.

    +20 days
  6. iOS 16.5.1(Patch)

    Fixes CVE-2023-32434, the Triangulation kernel bug.

    +78 days (about 3 months)
  7. BLASTPASS disclosed(Patch)

    Citizen Lab reports the PassKit and WebP chain; iOS 16.6.1 fixes CVE-2023-41064 and CVE-2023-41061 the same day. Lockdown Mode blocked it.

Operation Triangulation

In 2023, Kaspersky published Operation Triangulation: an iOS spyware campaign aimed at Kaspersky employees via zero-click iMessage exploits. The chain burned four zero-days:

  1. Remote code execution in a TrueType font instruction.
  2. An integer overflow giving read/write access to kernel memory.
  3. Exploitation of a hardware feature in Apple's GPU that bypassed hardware-level memory protection.
  4. A WebKit bug in Safari, used later in the chain to run the attackers' validator stage in the browser.

Step 3 is the eye-popper. The exploited hardware feature was a set of undocumented MMIO registers tied to Apple's custom GPU, neither publicly documented nor known to the wider research community — raising some uncomfortable questions about how the attackers found out about it.

Predator (Cytrox/Intellexa)

Predator, built by Cytrox (part of the Intellexa Alliance), is Pegasus's main rival. Where Pegasus prefers zero-click, Predator has been seen leaning on one-click exploits delivered through SMS or WhatsApp links. Architecturally it's modular: the initial implant (ALIEN) bootstraps the main platform (PREDATOR), which then loads further modules for specific surveillance jobs.

iOS Forensic Analysis

Analysing iOS devices for spyware requires different tools and techniques than Android, primarily because iOS does not permit installation of arbitrary analysis applications and the filesystem is not directly accessible without a jailbreak.

Backup Analysis

The primary forensic approach is to analyse an iTunes/Finder backup. A full unencrypted backup contains application data for stock apps, call history, WiFi connection history, and configuration profiles. An encrypted backup also pulls in keychain entries, health data, and WiFi passwords.

What to Look For

iOS forensic analysis focuses on indirect indicators because the spyware binary itself may not be present in backups:

  • DataUsage.sqlite / netusage.sqlite: Record which processes made network connections and data volumes. Pegasus implant process names appear in these databases.
  • Shutdown log: iOS records process information during shutdowns. Spyware processes appear here even when hidden from standard listings.
  • SMS database: Check for messages containing known exploitation links.
  • Safari history: Identify visits to known exploitation domains.
  • Configuration profiles: Unexpected profiles may indicate social engineering attacks or MDM-based compromise.
The Limits of iOS Forensics

iOS forensic analysis from backups is inherently limited. Backups do not contain the full filesystem - system files, running processes, and kernel-level implants are not included. Sophisticated spyware operating at kernel level may leave no traces in backup data. Full filesystem analysis requires either a jailbroken device or a forensic extraction tool. This is why forensic tools check for indirect indicators - network database anomalies, process execution traces, and configuration artefacts - rather than looking for the implant binary directly.

MVT: Mobile Verification Toolkit

Amnesty International's MVT is the standard tool for checking iOS devices for spyware indicators. MVT analyses iOS backups and filesystem dumps, checking against STIX2-formatted indicators of compromise. Its iOS modules include SMS database analysis, Safari history checking, timeline generation, network usage database analysis, and shutdown log parsing.

MVT was central to the Pegasus Project investigation that revealed widespread targeting of journalists and activists across dozens of countries.

At its core, MVT's IOC check is a join: process names from the backup's databases against names in the STIX2 file, then everything sorted into a timeline. The rows below are synthetic, but the three indicator names come from Amnesty's published Pegasus IOCs.

Try itBefore running, spot the lookalike sitting next to a real Apple daemon. Then look at which network the flagged processes used and what ran seconds before the first hit.
C (GCC 9.2.0)