Atomic Stealer's Dyld Injection Tactics
Tonmoy Jitu (Threat Researcher · Sophos)
BSides Canberra VIII (2025) · Day 2 · Main Track
Overview
In this insightful talk from BSides Canberra, Tonmoy Jitu, a Threat Researcher at Sophos, delved into the evolving landscape of macOS malware, specifically focusing on the advanced Dyld injection tactics employed by the Atomic Stealer malware. Jitu highlighted the critical importance of understanding these techniques, given the rapid increase in macOS enterprise adoption and a staggering 60% rise in macOS malware detections in 2023. The presentation served as a deep dive into how Atomic Stealer leverages dynamic link library injection to bypass macOS security mechanisms, establish persistence, and exfiltrate sensitive user data.

Key moments
- 1:00 Mac OS malware landscape and rising info-stealers
- 3:25 Atomic Stealer's VM detection bypass technique
- 4:40 Explaining dyld injection using environment variables
- 13:15 Detailed 7-phase Atomic Stealer attack chain
- 16:00 Data exfiltration targets and collection limits
- 18:50 Practical detection strategies for Atomic Stealer
- 22:00 Current exposure and speaker's final opinion
Atomic Stealer's Dyld Injection Tactics
Speakers: Tonmoy Jitu, Threat Researcher, Sophos
Conference: BSides Canberra
YouTube: https://www.youtube.com/watch?v=Uz3LrTXbb-4
Overview
In this insightful talk from BSides Canberra, Tonmoy Jitu, a Threat Researcher at Sophos, delved into the evolving landscape of macOS malware, specifically focusing on the advanced Dyld injection tactics employed by the Atomic Stealer malware. Jitu highlighted the critical importance of understanding these techniques, given the rapid increase in macOS enterprise adoption and a staggering 60% rise in macOS malware detections in 2023. The presentation served as a deep dive into how Atomic Stealer leverages dynamic link library injection to bypass macOS security mechanisms, establish persistence, and exfiltrate sensitive user data.
The talk meticulously dissected the Atomic Stealer's infection chain, from its initial delivery via social engineering to its sophisticated anti-analysis techniques, self-signing capabilities, and process masquerading. Jitu, a first-time speaker with a keen interest in uncovering previously undetected malware, emphasized the threat posed by info-stealers, which have shown a consistent upward trend in the macOS ecosystem. His research on a specific Atomic Stealer sample, initially undetected by VirusTotal for an extended period, underscored the malware's stealth and the challenges it presents to traditional security defenses.
This article aims to unpack Jitu's findings, providing a comprehensive technical analysis of Atomic Stealer's methods. It will explore the intricacies of Dyld injection, the malware's multi-architecture support, its evasion of virtual machine detection, and the critical role of permissive entitlements in its operation. Furthermore, it will outline actionable defensive strategies and indicators of compromise (IOCs) that security professionals can utilize to detect and mitigate the threat posed by this sophisticated macOS info-stealer.
Background
▶ Watch: Mac OS malware landscape and rising info-stealers (1:00)
The macOS operating system, once perceived as a less frequent target for malware, has witnessed a significant surge in malicious activity, particularly with the increasing adoption of Apple devices in enterprise environments. This growing attack surface has led to a proliferation of new malware families, with info-stealers like Atomic Stealer becoming a dominant threat. These malicious programs aim to surreptitiously collect sensitive user data, including credentials, cryptocurrency wallet keys, and personal files.
A key technique exploited by Atomic Stealer, and the central theme of Jitu's talk, is dynamic load library (Dyld) injection. Dyld is the dynamic linker used by macOS, responsible for loading dynamic libraries into applications at runtime. While legitimate applications use Dyld for modularity and shared code, adversaries can abuse its mechanisms to inject malicious code into otherwise benign processes. Jitu explained that Dyld injection can occur through various means, including environment variables, binary modification, and runtime injection. For Atomic Stealer, the focus is on abusing environment variables, specifically DYLD_INSERT_LIBRARIES. This environment variable, when set, instructs the dynamic linker to load specified libraries before any others, effectively allowing an attacker to inject and execute their own malicious code within a targeted application's process space. The speaker noted the official Apple definition for this variable was difficult to locate, indicating a potential shift in Apple's documentation strategy.
Apple has implemented several security mitigations over the years to counter such threats. These include:
- System Integrity Protection (SIP): Blocks modification of system paths, reducing hijacking opportunities.
- Gatekeeper: Checks code signing on downloaded applications and blocks unsigned or untrusted apps.
- Hardened Runtime: Enforces library validation, ensuring only valid libraries are run.
- Notarization: Apple's process of scanning software for malicious components, blocking unauthorized code.
- Entitlement Restrictions: Limits risky entitlements, which are specific permissions an application requests.
- The
com.apple.security.cs.allow-dyld-environment-variablesentitlement: A specific control designed to restrict the use of Dyld environment variables.
However, as Jitu detailed, Atomic Stealer is designed to bypass these measures, particularly by exploiting vulnerabilities in non-hardened, third-party applications that may have weak imports or insecure permissions. The malware's ability to self-sign with permissive entitlements and masquerade its processes allows it to circumvent Gatekeeper and operate at the host level, often requesting privileges that bypass SIP's protection against kernel-level modifications. The speaker highlighted a specific Atomic Stealer sample submitted to VirusTotal on March 3rd, which initially showed zero detections for over 10 days, demonstrating its ability to evade initial analysis and detection by security vendors. This prolonged dwell time for an active sample underscores the necessity for advanced behavioral analysis and continuous threat intelligence.
Key Findings
▶ Watch: Explaining dyld injection using environment variables (4:40)
Tonmoy Jitu's research on Atomic Stealer unveiled several critical findings regarding its sophisticated evasion techniques and attack methodology:
- Prolonged Zero-Day Evasion: A specific Atomic Stealer sample, submitted to VirusTotal on March 3rd, was observed to have zero detections for approximately 10 days. This indicated a significant window where the malware could operate undetected, likely due to its anti-analysis techniques preventing dynamic analysis engines from fully observing its malicious behavior.
- Sophisticated Anti-Analysis: The malware incorporates robust anti-analysis mechanisms, primarily targeting virtual machine (VM) environments. It explicitly checks for the presence of QEMU or VMware infrastructure. If detected, the malware terminates its execution, thereby appearing benign to automated sandbox analyses like those on VirusTotal. This behavior directly contributed to its initial low detection rates.
- Multi-Architecture Support: Atomic Stealer is a universal binary, supporting both Intel (x86) and ARM64 architectures. This ensures its efficacy across older Intel-based Macs and newer Apple Silicon (M-series) devices, maximizing its potential victim pool.
- Gatekeeper Bypass via Social Engineering: The malware typically arrives as a DMG installer disguised as legitimate software. It instructs users to "right-click and open," a known method to bypass Gatekeeper's initial warning for untrusted applications, thereby enabling execution of its unsigned or invalidly signed code.
- Self-Signing with Overly Permissive Entitlements: A core technical finding is the malware's self-sign function. This function generates XML-based entitlement files in the temporary directory, granting itself highly permissive entitlements, crucially including
com.apple.security.cs.allow-dyld-environment-variables. This entitlement explicitly permits the use of Dyld environment variables for injection, a critical step in its attack chain. It also disables page protection to modify memory. - Process Masquerading: To hide its malicious activity, Atomic Stealer employs process masquerading. It identifies benign, hard-coded macOS process names (e.g.,
networker,helper,security agent,system events) and renames its child processes to mimic these legitimate system services, making it harder for users and basic monitoring tools to spot anomalies. DYLD_INSERT_LIBRARIESAbuse: The malware leverages theDYLD_INSERT_LIBRARIESenvironment variable to inject its malicious dynamic load library into a benign parent process. This allows its malicious child process to execute with the context and potentially elevated privileges of the spoofed benign application.- Data Exfiltration Limits and HTTP C2: Atomic Stealer enforces a 10MB data collection limit per exfiltration attempt. This small data size is likely intended to evade detection by Data Loss Prevention (DLP) systems. Furthermore, the malware communicates with its Command and Control (C2) server using unencrypted HTTP, sending collected data in an
out.zipfile every 5 minutes. Jitu humorously questioned why attackers in 2025 (referring to the future context of his talk) would still use unencrypted HTTP, highlighting a significant detection opportunity.
These findings collectively paint a picture of a sophisticated, adaptable, and stealthy macOS info-stealer that actively works to bypass standard security measures and blend into legitimate system activity.
Technical Deep Dive
▶ Watch: Detailed 7-phase Atomic Stealer attack chain (13:15)
Atomic Stealer’s operation is characterized by a multi-stage attack chain designed for stealth, persistence, and data exfiltration. Its core functionality revolves around the abuse of macOS's dynamic linker and careful manipulation of system processes.
The malware targets all macOS versions and exhibits multi-architecture support, operating on both Intel (x86) and ARM64 systems. Delivered primarily via DMG installers through phishing campaigns or malvertising, it impersonates legitimate applications, often instructing users to "right-click and open" to bypass Gatekeeper. The binary typically has non-existent or invalid code signing, relying on this social engineering tactic for initial execution.
Upon execution, the DMG installer acts as a dropper. It first performs VM and debugger detection by checking for specific system attributes associated with QEMU or VMware. This anti-analysis technique causes the malware to exit if a virtualized environment is detected, effectively cloaking its true behavior from automated sandboxes. Jitu described how he bypassed this by using LLDB to set a breakpoint and zero out the thread checking for VM attributes, allowing him to extract the clear text code.
The injection process flow begins with a stager app (the DMG file). Once run, it adds shellcode to a macro binary. This then spawns two processes: a benign parent process and a malicious child process. The child process is responsible for calling the malicious library and injecting it using Dyld.
A critical component of this process is the malware's self-sign function. This function generates XML-based entitlement files that are saved in the temporary directory. These entitlements are excessively permissive, notably including com.apple.security.cs.allow-dyld-environment-variables. This specific entitlement is crucial as it grants the binary permission to use Dyld environment variables for injection, effectively circumventing Apple's default restrictions. The self-sign function also disables page protection, allowing the malware to modify its own memory space for injection.
Following self-signing, the malware performs process masquerading via a function named mask_process_name. It identifies one of four hard-coded benign macOS process names: networker, helper, security agent, or system events. The child process then renames itself to one of these, blending into the list of running processes and making it harder to detect anomalies. This is often achieved using OS Script to launch these spoofed processes.
The complete attack chain can be broken down into seven phases:
- Initial Compromise: The user downloads and executes the DMG file, writing the malware to the system.
- Self-Modification: The malware performs a code signing bypass, adds permissive entitlements (e.g.,
com.apple.security.cs.allow-dyld-environment-variables), sets itself as a hidden terminal process, and disables memory protection to facilitate in-memory writes. - Process Masquerading: It selects a benign process name from its hard-coded list and launches a child process with this spoofed identity.
- Dyld Injection: The malware sets the
DYLD_INSERT_LIBRARIESenvironment variable, pointing to its malicious library, which is then loaded into the masqueraded process. - C2 Communication: A Command and Control (C2) channel is established, typically using
curlover unencrypted HTTP. It sends a user ID and a build ID (useful for tracking campaigns) to the C2 server. - Operational Activities: The malware proceeds with its primary objective:
- Screen Capture: Takes screenshots every 5 minutes, transmitting them back to the C2.
- Command Reception and Execution: Receives and executes commands from the C2 to maintain persistence and perform further actions.
- Process Health Check: Monitors its own processes to ensure continuous operation.
- Data Collection: Targets Chromium-based browser data, general text files (PDFs, DOCs) where users might store credentials, and SQLite database files (common in macOS applications). For cryptocurrency theft, it has hard-coded wallet extension names to find and exfiltrate keys. It also collects system intelligence, including hardware information, installed applications, and even validates user passwords against the system.
- Collection Limit: To evade DLP systems, it enforces a strict 10MB limit on the size of data exfiltrated in a single transfer.
- Cleanup: In the final phase, the malware performs temporary file deletion (using
rm -rfonout.zipand other temporary artifacts), log tampering, and memory cleanup to remove traces of its activity.
The C2 communication is noteworthy for its use of unencrypted HTTP, with data typically sent as an out.zip file. This choice of protocol, while surprising for modern malware, provides a clear opportunity for network-based detection.
Jitu also pointed out that Dyld injection is not a new technique and has been exploited in recent CVEs, such as those affecting legitimate applications like DaVinci Resolve and Fast CAD Reader. These applications, when developed with weak imports or insecure permissions, become susceptible to Dyld hijacking. Active tooling like Spectre, Mythic, Mac Injector Automated, and Dyld Hijacking Toolkit continue to evolve, demonstrating the ongoing relevance and exploitation of these techniques.
Demo / Proof of Concept
▶ Watch: Practical detection strategies for Atomic Stealer (18:50)
While the talk did not feature a live, interactive demonstration or a traditional proof of concept execution, Tonmoy Jitu thoroughly detailed the step-by-step process of the Atomic Stealer's Dyld injection and its anti-analysis bypass. He described the specific line of code responsible for VM detection (checking for QEMU or VMware) and explained his own methodology for bypassing this check using LLDB breakpoints to zero out the relevant thread. This detailed explanation of his reverse engineering process and how he extracted the clear text code served as a conceptual walkthrough of the malware's capabilities and how they can be observed.
Defensive Implications
▶ Watch: Current exposure and speaker's final opinion (22:00)
Defending against sophisticated macOS info-stealers like Atomic Stealer requires a multi-layered approach, focusing on host-based monitoring, network analysis, and continuous vigilance for specific indicators of compromise. Tonmoy Jitu provided several actionable strategies for defenders:
- Enhanced Host-Based Logging:
- Unified Logs: Monitor macOS unified logs for network-based artifacts, specifically looking for entries related to
com.apple.networkor any of the spoofed process names (networker,helper,security agent,system events). - Detailed Logging: Enable detailed macOS logging (
log streamcommand) to capture more granular information, especially concerning Dyld injection processes. While this may generate a high volume of false positives, correlating these logs with other suspicious activities can help identify true positives. - Keychain Access: Monitor unified logs for any unauthorized or suspicious access to the user's keychain, as info-stealers will invariably attempt to exfiltrate stored credentials. Reduce the monitoring window (e.g., to 30 minutes) for more focused analysis.
- Persistence Mechanism Monitoring:
- SSH Keys: Regularly check for newly created or modified SSH keys, as attackers often use these for persistence.
- Launch Daemons and Agents: Monitor
~/Library/LaunchAgents/and/Library/LaunchDaemons/for malicious auto-start entries. Jitu provided a useful one-liner:defaults read ~/Library/LaunchAgentsto inspect user-level launch agents.
- Dyld Injection Detection:
DYLD_INSERT_LIBRARIESUsage: Actively monitor logs for the use of theDYLD_INSERT_LIBRARIESenvironment variable. While benign applications can use this, correlating its usage with suspicious process IDs (PIDs) or unknown binaries can help distinguish malicious activity.- Entitlement P-lists: Look for temporary entitlement P-lists being created in
/tmpdirectories, especially those grantingcom.apple.security.cs.allow-dyld-environment-variablesor other excessive permissions.
- Process and File System Monitoring:
- Process Behavior Analysis: Utilize tools like
dtruss(once a suspicious PID is identified) for in-depth process behavior analysis. - File Creation Monitoring: Use
opensnoopto monitor for suspicious file creations, particularlyout.zipin temporary directories, which Atomic Stealer uses for exfiltration. - Hidden Files/Folders: Regularly scan for binaries appearing in temporary or hidden folders.
- Process Name Mimicking: Be alert for processes mimicking legitimate Apple service names, especially those not launched by expected parent processes.
- Network-Based Detection:
- C2 Connections: Monitor network traffic for connections to unknown public IP addresses or suspicious domains.
- Unencrypted HTTP: The malware's reliance on HTTP for C2 communication and data exfiltration (e.g.,
out.zip) presents a significant opportunity for network intrusion detection systems (NIDS) to flag unencrypted data transfers, especially from unusual processes. - Dedicated C2 Ports: Some variants use easily identifiable dedicated ports like
999or888. Monitor for outbound connections to these ports.
- User Education and Application Hardening:
- Social Engineering Awareness: Educate users about the dangers of downloading software from unofficial sources and the "right-click open" Gatekeeper bypass.
- Application Hardening: Prioritize using applications from the App Store or those that are properly notarized and hardened. Non-hardened, third-party applications with weak imports or insecure permissions are the primary targets for Dyld hijacking.
Jitu concluded by acknowledging that while newer macOS versions and hardened App Store applications offer better protection, Atomic Stealer operates at the host level, often bypassing SIP by gaining user privileges. Its relatively non-stealthy nature, leaving numerous artifacts, makes it detectable with proper monitoring. However, its effectiveness against vulnerable, low-privilege third-party applications underscores the ongoing need for robust security practices.
Key Takeaways
- Dyld Injection Remains a Potent Threat: The
DYLD_INSERT_LIBRARIESenvironment variable, when combined with permissive entitlements, continues to be a critical vector for macOS malware, enabling code injection and privilege escalation, especially against non-hardened third-party applications. - Atomic Stealer's Sophisticated Evasion: This info-stealer employs a multi-faceted approach to evade detection, including anti-analysis checks for virtual machines (QEMU, VMware), self-signing with overly permissive entitlements (e.g.,
com.apple.security.cs.allow-dyld-environment-variables), and process masquerading to mimic legitimate macOS services. - Multi-Stage Attack Chain for Persistence and Exfiltration: Atomic Stealer's attack chain involves initial compromise via social engineering (DMG files), self-modification to bypass security, Dyld injection, C2 communication, persistent data collection (screenshots, browser data, crypto keys), and cleanup operations.
- Critical Detection Opportunities Exist: Despite its sophistication, the malware leaves numerous artifacts. Defenders can leverage detailed macOS unified logs, monitor for
DYLD_INSERT_LIBRARIESusage, detect temporary entitlement P-lists, observe process masquerading, and identify unencrypted HTTP C2 communications (especiallyout.zipexfiltration and dedicated C2 ports). - Focus on Non-Hardened Applications: The primary targets are non-hardened, third-party applications downloaded outside the App Store, which may possess weak imports or insecure permissions. User education and stringent software vetting are crucial to minimize this attack surface.
About the Speaker(s)
Tonmoy Jitu is a Threat Researcher at Sophos, a leading cybersecurity company. This presentation at BSides Canberra marked his debut as a conference speaker. His professional interests are deeply rooted in uncovering new and emerging threats, particularly focusing on malware binaries that often go undetected (zero-detection files). He is passionate about reverse engineering malware to understand their inner workings and meticulously hunting for anomalies within system logs to identify malicious activity. His work contributes to the broader understanding and defense against advanced persistent threats in the evolving cybersecurity landscape.