
Cybersecurity / Malware
Malware on macOS and iOS
Threats targeting Apple’s desktop and mobile ecosystems, from stealthy persistence mechanisms and code-signing abuses to documented infostealer campaigns and nation‑state zero‑click exploit chains.
macOS malware leverages LaunchAgents, LaunchDaemons, and entitlement misuse to maintain persistence, while attackers bypass Gatekeeper through code‑signing vulnerabilities and quarantine attribute stripping. The Atomic (AMOS) stealer harvests credentials and cryptocurrency wallets via trojanized cracked apps. On iOS, the Pegasus spyware chain delivers zero‑click exploits via iMessage, using undisclosed vulnerabilities in CoreGraphics, HomeKit, Find My, and PassKit to gain silent remote code execution.
Overview and context
Although macOS enjoys a reputation for security due to its Unix foundation and Gatekeeper controls, malware authors have consistently found ways to subvert its defenses. Persistence is commonly achieved through launch agents placed in ~/Library/LaunchAgents/ or launch daemons in /Library/LaunchDaemons/, often masquerading as legitimate Apple services. Code‑signing bypasses exploit flaws in signature verification (such as CVE‑2022-42841) or abuse notarization, allowing malicious payloads to appear trusted. Once executed, stealers like AMOS exfiltrate passwords, browser data, and cryptocurrency wallets, while iOS‑focused threats such as Pegasus rely on zero‑click chains that require no user interaction, chaining exploits in frameworks like HomeKit or PassKit before ultimately escaping the BlastDoor sandbox.
The defensive landscape is shaped by Apple’s rapid patch cadence and the introduction of Lockdown Mode, which mitigates many known exploit vectors. However, the commercial nature of malware‑as‑a‑service means that techniques evolve quickly, necessitating continuous monitoring of launch items, unsigned memory allocations, and anomalous network connections to known command‑and‑control infrastructure.
Technical and feature breakdown
macOS Persistence & Entitlements
Persistence on macOS is primarily managed by launchd, which reads property‑list files from specific directories. LaunchAgents run per‑user session and are stored in ~/Library/LaunchAgents/ (user‑specific) or /Library/LaunchAgents/ (available to all users). LaunchDaemons operate system‑wide, independent of any user login, and reside in /Library/LaunchDaemons/. Both use a Label key for identification and ProgramArguments to specify the executable. Malware commonly masks its plist with Apple‑like names (e.g., com.apple.softwareupdate.plist) to avoid suspicion. Entitlements, embedded in signed binaries, grant special privileges such as com.apple.security.cs.allow‑unsigned‑executable‑memory, which allows execution of unsigned memory—a capability abused when malware steals or forges legitimate signing credentials. Modern macOS versions also expose a BackgroundTaskManagement database that aggregates launch agents, daemons, and login items, providing defenders a centralized view of persistence mechanisms.
Code‑Signing & Gatekeeper Bypass
Gatekeeper enforces quarantine attribute checks, notarization, and valid code signatures before allowing an application to run. Malware bypasses Gatekeeper through several documented techniques: stripping the com.apple.quarantine extended attribute via xattr -d com.apple.quarantine, exploiting signature verification flaws (such as CVE‑2022-42841, which permitted modification of a .pkg’s checksum offset while preserving a valid signature), or abusing Apple’s notarization process—OSX/Shlayer, for example, was notarized by Apple despite being malicious. Additionally, attackers may use unsigned memory execution entitlements (com.apple.security.cs.allow‑unsigned‑executable‑memory) to run code that would otherwise be blocked by Hardened Runtime. These methods often appear in combination: a trojanized DMG may first remove quarantine attributes, then rely on a code‑signing vulnerability to appear trusted, and finally execute with the aid of abused entitlements.
macOS Infostealer Chains (Atomic/AMOS)
The Atomic macOS Stealer (AMOS) is a commercial infostealer sold as a malware‑as‑a‑service, first observed in early 2023. It is distributed via trojanized applications advertised as cracked software or through malicious Terminal commands that curl a payload and execute it. AMOS is a universal Mach‑O binary (Intel and Apple Silicon) that employs a rolling XOR cipher (key: 7M43mJx9I0GwjslSA2oKSgkqsUo) to obfuscate strings, hindering static analysis. Upon execution, it removes the quarantine attribute from its own binary, installs a persistence LaunchAgent in ~/Library/LaunchAgents/ with a random name, and begins harvesting data.
Targets include browser password stores (Chrome, Firefox, Safari, Edge, Brave), Apple Keychain, cryptocurrency wallets (over 20 implementations including Ethereum, Electrum, Monero, Exodus, and hardware wallets such as Trezor and Ledger), Telegram session data, Apple Notes, and OpenVPN configurations. The stealer captures silent screenshots via screencapture -x and profiles the hardware using system_profiler SPHardwareDataType. Exfiltration occurs over plain HTTP to hard‑coded C2 servers (historically 85.217.222.185), transmitting stolen data as POST parameters. Evasion tactics include muting system audio, aborting execution if the system locale matches certain Commonwealth of Independent States (CIS) languages, and performing basic virtualization checks for QEMU, VMware, or KVM indicators.
AMOS at a glance — the documented attributes the paragraph lists, separated so the collection targets and the evasion steps can be read independently.
| Attribute | Documented detail | Why it matters |
|---|---|---|
| Distribution | Cracked apps and malicious Terminal commands | Relies on the user running the payload |
| Collection | Browser stores, Keychain, wallets, Telegram, Notes, VPN configuration | Turns one host into many account takeovers |
| Evasion | Sandbox and virtualization checks; CIS-locale abort | Refuses analysis environments |
| Exfiltration | Plain HTTP POST to hard-coded servers | Its network signature is a detection opportunity |
| Persistence | LaunchAgent with a random name | Re-establishes the stealer after reboot |
Reading — the collection row is the impact, while the evasion and exfiltration rows are the places a defender can still see the operation.
iOS Implant Mechanics (Pegasus zero‑click chain)
Pegasus, developed by NSO Group, is a sophisticated iOS implant that achieves infection via zero‑click exploits—requiring no interaction from the device owner. Citizen Lab has analyzed multiple chains, each consisting of two stages: an initial foothold in a less‑exposed service (such as HomeKit, Find My, or PassKit) followed by a pivot to iMessage’s BlastDoor sandbox where the final code execution occurs. The FORCEDENTRY chain (CVE‑2021-30860) exploited an integer overflow in CoreGraphics’ JBIG2 parser, enabling an out‑of‑bounds canvas that allowed logical bitwise operations to construct a Turing‑complete circuit in memory.
The 2022 trio (PWNYOURHOME, FINDMYPWN, LATENTIMAGE) abused HomeKit’s homedaemon or Find My’s fmfd to leak PAC‑valid pointers, then processed malicious iMessage attachments (PNG images) to bypass Pointer Authentication Codes (PAC) and launch Pegasus via mediaserverd. The BLASTPASS chain (CVE‑2023-41064/CVE‑2023-41061) used malicious PassKit attachments containing images to compromise devices up to iOS 16.6, with Lockdown Mode blocking the attack. Across these chains, the exploit developers demonstrate sophisticated techniques to bypass modern mitigations such as Pointer Authentication, heap hardening, and sandbox escapes, ultimately installing the Pegasus payload that gains read/write access to the device’s filesystem, microphone, camera, and communications.
The documented zero-click chains — each chain the paragraph names, its entry service, and its key mechanism.
| Chain | Entry | Mechanism |
|---|---|---|
| FORCEDENTRY (CVE-2021-30860) | iMessage attachment | Integer overflow in the CoreGraphics JBIG2 parser |
| PWNYOURHOME, FINDMYPWN, LATENTIMAGE | HomeKit or Find My | Pointer leak, then a malicious iMessage image |
| BLASTPASS (CVE-2023-41064/41061) | PassKit attachment | Malicious image; blocked by Lockdown Mode |
Reading — the entry service changes across chains, but each chain ends in the same place: code execution without a user decision, which is why Lockdown Mode removes the entry surface rather than patching one bug.
The encryption example, annotated
This document’s working example illustrates a defensive check for unauthorized LaunchAgents—a common persistence vector for macOS malware. The first code block lists all user‑specific LaunchAgents and flags those with non‑standard labels, helping analysts spot potential malware. The second code block demonstrates how to verify that a downloaded file still carries the quarantine attribute, a critical Gatekeeper control that malware often strips.
Both snippets are intended for educational and defensive purposes only; they show what a security analyst might run during triage or hunting exercises. They do not contain malicious functionality and are safe to execute in a controlled laboratory environment.
LaunchAgent audit — list user LaunchAgents and highlight atypical labels.
# List all LaunchAgents in the user domain and show the Label and ProgramArguments
defaults domains | grep -E '^.*$' | while read domain; do
/usr/libexec/PlistBuddy -c "Print :Label" ~/Library/LaunchAgents/"$domain".plist 2>/dev/null | \
if [ -n "$REPLY" ]; then
printf "%s: %s\\n" "$domain" "$REPLY"
fi
done
Quarantine attribute verification — confirm that a downloaded file retains the com.apple.quarantine xattr.
# Check whether a file downloaded via a browser or cursor still has the quarantine attribute
if /usr/bin/xattr -p com.apple.quarantine "/path/to/downloaded.file" 2>/dev/null; then
echo "Quarantine attribute present – Gatekeeper will intervene on launch."
else
echo "Quarantine attribute missing – file may have been tampered with."
fi
Comparative data and specs
The table below contrasts macOS and iOS malware mechanisms across four categories: persistence, trust‑bypass, data theft, and zero‑click exploitation. Values are condensed from publicly documented cases and technical reports cited in the Sources section.
Documented Pegasus zero‑click chains per year — counts based on Citizen Lab disclosures of distinct exploit chains.
Reading — each bar represents the number of unique zero‑click exploit chains publicly attributed to Pegasus in that year; 2022 saw three distinct chains disclosed, while 2021 and 2023 each had one.
macOS versus iOS malware mechanisms — the comparison table from the section above, given the full page width so every cell stays readable.
| Category | macOS | iOS |
|---|---|---|
| Persistence | LaunchAgents/LaunchDaemons, login items, cron | Profit‑based plists, jailbreak‑based daemons (when jailbroken) |
| Trust‑bypass | Code‑signing flaws (CVE‑2022-42841), notarization abuse, quarantine stripping | Enterprise certificate abuse, zero‑click vulns in iMessage/PassKit/HomeKit |
| Data theft | Credential dumping, cryptowallet exfiltration (AMOS) | Microphone/camera access, SMS/iMessage interception, device mapping (Pegasus) |
| Zero‑click | Rare (local privilege escalation) | Multiple documented chains (FORCEDENTRY, PWNYOURHOME, FINDMYPWN, BLASTPASS) |
macOS vs. iOS malware capabilities, summarized from public research.
Actionable steps for analysts
-
LaunchItem audit
Enumerate all LaunchAgents and LaunchDaemons in standard and user locations, comparing labels against known good baselines. Use defaults domains or /usr/libexec/PlistBuddy to extract Label and ProgramArguments, then flag entries with random‑looking names or non‑Apple‑signed binaries.
-
Quarantine and attribute monitoring
Watch for removal of the com.apple.quarantine extended attribute on newly downloaded files, especially those executed shortly after download. Audit processes that call xattr -d com.apple.quarantine without a clear legitimate purpose.
-
Unsigned memory execution detection
Monitor for the entitlements com.apple.security.cs.allow‑unsigned‑executable‑memory or com.apple.security.cs.disable‑executable‑page‑protection in processes that are not Apple‑signed. Combine with YARA rules targeting known malware strings (e.g., the AMOS XOR key 7M43mJx9I0GwjslSA2oKSgkqsUo).
-
Network‑C2 correlation
Correlate outbound HTTP POSTs to uncommon IP addresses or domains with local processes exhibiting suspicious behavior (e.g., sudden screencapture or system_profiler calls). Maintain a blocklist of known malware C2 endpoints such as 85.217.222.185 for AMOS.
-
iOS forensic readiness
For iOS devices, ensure backups are encrypted and regularly verified; monitor installed configuration profiles for unfamiliar entries; and, if compromise is suspected, employ mobile‑device‑management (MDM) tools to collect logs and, where possible, acquire a filesystem image via trusted pairing record methods.
Each check, what it looks for, and the artifact it reads — the five steps as an operating list for macOS and iOS.
| Check | Looks for | Artifact |
|---|---|---|
| LaunchItem audit | Random labels and non-Apple signatures | LaunchAgents and LaunchDaemons |
| Quarantine monitoring | Quarantine attribute removed after download | Extended attributes |
| Unsigned memory detection | Unsigned executable memory entitlements | Process entitlements and YARA hits |
| Network-C2 correlation | Uncommon outbound POSTs | Process and flow records |
| iOS forensic readiness | Unknown profiles and weak backup state | Configuration profiles and backups |
# First two commands
xattr -p com.apple.quarantine file; launchctl list
Reading — the desktop checks centre on persistence and trust, while the iOS check centres on readiness, because a compromised phone may offer no live process to examine.
Additional context — the role of Apple’s security updates
Apple’s rapid patch cycle has been instrumental in mitigating many of the techniques described herein. Each zero‑click chain disclosed by Citizen Lab prompted an expedient security update: FORCEDENTRY was addressed in iOS 14.8/macOS Big Sur 11.6, the 2022 trio received patches across iOS 16.3–16.5, and BLASTPASS was blocked by iOS 16.6.1. However, the lag between exploit discovery and patch deployment creates a window during which zero‑click attacks remain effective. Organizations should prioritize rapid update deployment, especially for fleets of macOS and iOS devices, and consider enabling automated updates where feasible.
Additional context — defending against supply‑chain attacks
Many macOS infections begin with trojanized applications masquerading as cracked or pirated software, a classic supply‑chain compromise. Defenders should enforce application‑control policies that allow only signed, notarized software from trusted sources, and utilize tools that verify the integrity of downloaded binaries (e.g., checking notarization status with spctl -a -t exec -vv /path/to/app). Educating users about the risks of unofficial software distribution channels reduces the likelihood of initial infection, while endpoint detection and response (EDR) solutions can flag the execution of unsigned memory or the removal of quarantine attributes as early warning signs.
Supply-chain controls for Mac fleets — the section's recommendations, each paired with the signal that shows it is working.
| Control | What it does | Signal it works |
|---|---|---|
| Application control | Allows only signed, notarized software | Unsigned apps blocked at launch |
| Notarization check | Uses spctl to assess an app | Assessment result recorded |
| User education | Reduces use of unofficial channels | Fewer cracked-app installs |
| EDR detection | Flags unsigned memory and quarantine removal | Alerts on entitlement and xattr changes |
# Verify before launch
spctl -a -t exec -vv /path/to/app
Reading — the first three controls stop the trojanized installer before it runs; the fourth catches the cases that slip past them.
Quick reference — the rules at a glance
macOS and iOS present two different problems. On macOS, the platform offers strong defaults — code signing, notarization, Gatekeeper, and the launchd service manager — and malware succeeds by bending those defaults rather than breaking them. Persistence goes into LaunchAgents or LaunchDaemons with Apple-like names. Trust bypass comes from stripping the quarantine attribute, exploiting a signature-verification flaw, or abusing notarization. Once running, a stealer such as AMOS harvests browser stores, Keychain, wallets, and messaging sessions, and exfiltrates over plain HTTP. The defensive rule is to audit the launch items, watch the quarantine attribute, and flag unsigned executable memory.
On iOS, the problem is different in kind. Pegasus chains are zero-click, so no user decision exists to interrupt. Each documented chain enters through a less-exposed service, such as HomeKit, Find My, PassKit, or iMessage, then pivots into the BlastDoor sandbox. Lockdown Mode blocks documented chains by removing the entry surface, and Apple's rapid patches close them after disclosure. The defensive rule is readiness: encrypted backups, profile review, and a plan for collecting logs if compromise is suspected.
Across both, supply-chain deception is the common starting point. Trojanized cracked apps are the macOS version, and control of the software source is the answer to both. The final rule is therefore the oldest one on the page: what is installed is verified, and verified again after it runs.
Platform, threat, and control — the page's two halves side by side.
| Dimension | macOS | iOS |
|---|---|---|
| Persistence | LaunchAgents and LaunchDaemons | Rare on non-jailbroken devices |
| Trust bypass | Quarantine removal and signature flaws | Zero-click exploit chains |
| Data theft | AMOS harvests credentials and wallets | Pegasus reads messages, microphone, camera |
| Control | Launch-item audit and EDR | Lockdown Mode, patching, backups |
The two columns differ because the platforms expose different surfaces, which is why a single macOS control set does not transfer to iOS.
Failure modes and their warning signs — the ways this page's controls fail in practice.
| Failure mode | Warning sign | Response |
|---|---|---|
| Trusting the app's appearance | Apple-like name, non-Apple signer | Check the signature and launch item |
| Ignoring extended attributes | Quarantine missing after download | Audit xattr changes |
| No iOS readiness | Unencrypted or untested backup | Encrypt, verify, and rehearse |
| Delayed patching | Known chain still unpatched | Deploy updates and Lockdown Mode |
# Two questions
what signed this? what did it change at launch?
Both questions apply to every install, which is why the closing rule is about verification rather than about any single malware family.
- Designing Daemons and Services (Apple)
- Subvert Trust Controls: Gatekeeper Bypass, Sub‑technique T1553.001 (MITRE ATT&CK®)
- BLASTPASS: NSO Group iPhone Zero‑Click, Zero‑Day Exploit Captured in the Wild (Citizen Lab)
- FORCEDENTRY: NSO Group iMessage Zero‑Click Exploit Captured in the Wild (Citizen Lab)
- An MDR Analysis of the AMOS Stealer Campaign Targeting macOS via Cracked Apps (Trend Micro)
- Gatekeeper Bypass: Uncovering Weaknesses in a macOS Security Mechanism (Palo Alto Networks Unit 42)
- Figure source: Macintosh 512K computer (Wikimedia Commons)
- Figure source: macOS Terminal screenshot (Wikimedia Commons)
- Figure source: Apple M1 system on a chip (Wikimedia Commons)