XcodeSpy is a macOS malware campaign centered on trojanized Xcode projects used to target Apple software developers. It abuses Xcode’s Run Script build-phase functionality so that opening or building a malicious project executes hidden shell logic and installs a customized variant of the EggShell backdoor. The malware has been associated with a doctored copy of a legitimate open-source Xcode project and represents a developer-focused supply-chain style intrusion vector.
On infected systems, XcodeSpy deploys a persistent backdoor on macOS, commonly using LaunchAgents for persistence and masquerading its components as Apple-related files and directories. The customized EggShell payload provides remote access and surveillance capabilities, including keylogging, microphone and camera recording, screen capture, file upload and download, and clipboard access. It also supports broader post-compromise activity through backdoor functionality and covert data collection.
XcodeSpy is notable for targeting developers rather than general consumers, making it relevant to software supply-chain risk and espionage-oriented operations. Reporting has linked the campaign to custom EggShell samples active in 2020, with at least one confirmed victim in a U.S. organization and indications of additional targeting in Asia. The operation has been discussed in connection with suspected North Korean threat activity, but attribution remains cautious. XcodeSpy illustrates how trusted development workflows and shared project files can be weaponized to gain initial access and establish long-term surveillance on macOS endpoints.
11 distinct techniques documented for this family, organized by ATT&CK tactic.
The script creates a hidden file called .tag in the /tmp directory, which contains a single command: mdbcmd . This in turn is piped via a reverse shell to the attackers C2.
The XcodeSpy version, however, has been subtly changed to execute an obfuscated Run Script when the developer’s build target is launched.
On execution, the customized EggShell binaries drop a LaunchAgent either at ~/Library/LaunchAgents/com.apple.usagestatistics.plist or ~/Library/LaunchAgents/com.apple.appstore.checkupdate.plist.
On execution, the customized EggShell binaries drop a LaunchAgent either at ~/Library/LaunchAgents/com.apple.usagestatistics.plist or ~/Library/LaunchAgents/com.apple.appstore.checkupdate.plist.
XcodeSpy drops several files at paths using the “com.apple” reverse identifier and in subfolders named after legitimate macOS system software (TextEdit, Preview).
XcodeSpy hides several files with a dot prefix to make them hidden from view in the Finder application.
The backdoor has functionality for recording the victim’s microphone, camera and keyboard... MITRE ATT&CK TTPs Input Capture: Keylogging | XcodeSpy can log user keystrokes to intercept credentials as the user types them T1056 001.
MITRE ATT&CK TTPs Input Capture: GUI Input Capture | XcodeSpy can prompt users for credentials with a seemingly legitimate prompt via AppleScript T1056 002.
MITRE ATT&CK TTPs Process Discovery | XcodeSpy can collect data on running and parent processes T1057.
MITRE ATT&CK TTPs File and Directory Discovery | XcodeSpy can scan directories on a compromised host T1083.
The backdoor has functionality for recording the victim’s microphone, camera and keyboard... MITRE ATT&CK TTPs Input Capture: Keylogging | XcodeSpy can log user keystrokes to intercept credentials as the user types them T1056 001.
MITRE ATT&CK TTPs Input Capture: GUI Input Capture | XcodeSpy can prompt users for credentials with a seemingly legitimate prompt via AppleScript T1056 002.
MITRE ATT&CK TTPs Application Layer Protocol: Web Protocols | XcodeSpy can use HTTPS in C2 Communications T1071 001.
The script contacts the attackers’ C2 and drops a custom variant of the EggShell backdoor on the development machine.
30 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
4 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.