XAgentOSX
- Type
- Backdoor
- Capabilities
- Credential theftKeyloggingExfiltrationReconnaissancePost exploitationDefense evasion
- Platforms
- macOS
XAgentOSX, also known as OSX Sofacy, is a macOS backdoor associated with APT28 (Sofacy/Fancy Bear), a Russian cyberespionage group attributed to GRU Unit 26165. It provides host reconnaissance, surveillance, credential-access, and file-execution capabilities on compromised Mac systems.
The implant identifies the operating-system version and current user, enumerates running processes, and attempts to locate Firefox passwords. Its keylogger records keystrokes and active application-window information, handles special characters, and buffers 50 characters by default before transmitting captured input through command-and-control infrastructure. It can start and stop screenshot collection using native Apple graphics APIs. XAgentOSX also executes specified files through the native NSTask launch mechanism and deletes specified files using Apple's filesystem APIs, supporting post-compromise execution and artifact removal.
Associated threat actors
1 distinct threat actor Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
(Citation: XAgentOSX 2017)(Citation: Symantec APT28 Oct 2018)(Citation: US District Court Indictment GRU Oct 2018)
Techniques & procedures
13 distinct techniques documented for this family, organized by ATT&CK tactic.
Execution
2 techniques
Execution
Examples include "CookieMiner has looked for files in the user's home directory with 'wallet' in their name using find .", "Kinsing has used the find command to search for specific files", and "APT41 has executed file /bin/pwd on exploited victims."
[XAgentOSX](https://attack.mitre.org/software/S0161) contains the execFile function to execute a specified file on the system using the NSTask:launch method.(Citation: XAgentOSX 2017)
Stealth
1 technique
Stealth
[XAgentOSX](https://attack.mitre.org/software/S0161) contains the deletFileFromPath function to delete a specified file using the NSFileManager:removeFileAtPath method.(Citation: XAgentOSX 2017)
Credential Access
3 techniques
Credential Access
[XAgentOSX](https://attack.mitre.org/software/S0161) contains keylogging functionality that will monitor for active application windows and write them to the log, it can handle special characters, and it will buffer by default 50 characters before sending them out over the C2 infrastructure.(Citation: XAgentOSX 2017)
Agent Tesla can gather credentials from a number of browsers... APT33 has used a variety of publicly available tools like LaZagne to gather credentials... TrickBot can obtain passwords stored in files from web browsers such as Chrome, Firefox, Internet Explorer, and Microsoft Edge... SELECT action_url, username_value, password_value FROM logins; CryptUnprotectData
[XAgentOSX](https://attack.mitre.org/software/S0161) contains the getFirefoxPassword function to attempt to locate Firefox passwords.(Citation: XAgentOSX 2017)
Discovery
5 techniques
Discovery
[XAgentOSX](https://attack.mitre.org/software/S0161) contains the getInfoOSX function to return the OS X version as well as the current user.(Citation: XAgentOSX 2017)
[XAgentOSX](https://attack.mitre.org/software/S0161) contains the getProcessList function to run <code>ps aux</code> to get running processes.(Citation: XAgentOSX 2017)
[XAgentOSX](https://attack.mitre.org/software/S0161) contains the getInstalledAPP function to run <code>ls -la /Applications</code> to gather what applications are installed.(Citation: XAgentOSX 2017)
[XAgentOSX](https://attack.mitre.org/software/S0161) contains the readFiles function to return a detailed listing (sometimes recursive) of a specified directory.(Citation: XAgentOSX 2017) [XAgentOSX](https://attack.mitre.org/software/S0161) contains the showBackupIosFolder function to check for IOS device backups by running <code>ls -la ~/Library/Application\ Support/MobileSync/Backup/</code>.(Citation: XAgentOSX 2017)
XAgentOSX 'run[s] ls -la /Applications to gather what applications are installed.'
Collection
2 techniques
Collection
[XAgentOSX](https://attack.mitre.org/software/S0161) contains keylogging functionality that will monitor for active application windows and write them to the log, it can handle special characters, and it will buffer by default 50 characters before sending them out over the C2 infrastructure.(Citation: XAgentOSX 2017)
[XAgentOSX](https://attack.mitre.org/software/S0161) contains the takeScreenShot (along with startTakeScreenShot and stopTakeScreenShot) functions to take screenshots using the CGGetActiveDisplayList, CGDisplayCreateImage, and NSImage:initWithCGImage methods.(Citation: XAgentOSX 2017)
Command and Control
1 technique
Command and Control
[XAgentOSX](https://attack.mitre.org/software/S0161) contains the ftpUpload function to use the FTPManager:uploadFile method to upload files from the target system.(Citation: XAgentOSX 2017)
Recent activity
28 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.