In December of 2021, Intezer discovered a novel multi-platform malware[i]. Dubbed SysJoker, this backdoor written in C++ has the ability to infect Windows, Linux, and MacOS systems. In analyzed attacks, all 3 versions of the malware were seen to have similar capabilities such as registry modification, remote command execution, and the pulling/execution of second-stage malware.
This blog post will give a brief overview of each SysJoker variant and, using a Windows malware sample, will show how NetWitness EDR can help identify this backdoor in your environment.
The Windows version of SysJoker begins with a first stage DLL dropper. Using Powershell, the dropper DLL pulls a zipped SysJoker payload from an attacker-controlled domain. During execution of the malware, SysJoker will:
Once communication has been established with its C2 server (retrieved from XOR-encoded hardcoded link), SysJoker will ping the C2 server to receive its instructions. The malware can perform four actions[ii]:
The Linux version of SysJoker shares several of the same characteristics as the Windows variant. Once on a Linux system, the malware still sleeps in random intervals, retrieves a plethora of system information, and masquerades as a legit system file. The first distinction from its Windows counterpart is the method of achieving persistence. Instead of modifying the Run key registry for persistence, the Linux version creates a cron job to execute the malicious payload disguised as a system update. The titles of the payloads tend to follow a generic naming convention, with “update” being seen in analyzed attacks (ex: /home/$username/.Library/SystemServices/updateSystem). This version can also kill processes and/or remove any files with the same name as the designated system update file before placing a copy of itself on the victim machine.
The MacOS version of SysJoker is almost identical to the Linux variant, with the only key difference being how it establishes persistence on the infected host. This version creates a MacOS launch agent named “Apple launch service” (T1543.001 - Launch Agent, which in turn targets a generically named fake update file (ex: /Library/MacOsServices/updateMacOs) for repeated execution upon system start-up.
Using our NetWitness Threat Lab, I executed a SysJoker sample, 1ffd6559d21470c40dcf9236da51e5823d7ad58c93502279871c3fe7718c901c.exe[iii], on a Windows 10 VM host. After double-clicking the file from the system desktop, it rested for approximately 60 seconds before acting. Shortly after the rest period, the malware used Powershell to copy itself to C:\ProgramData\SystemData\igfxCUIService.exe.
Masquerading as igfxCUIService.exe, SysJoker began gathering the desired system information. First it grabbed the system MAC address (‘getmac’) and Serial number (‘get SerialNumber’). The output for each was saved to two separate text files, temps1.txt and temps2.txt.
Next, the username for the currently logged on user was queried via Powershell. The results of this command are saved to a new text file, tempu.txt.
As expected, the malware then uses Command Prompt (cmd.exe) to query the Windows Management Instrumentation CLI (wmic.exe) for details on the OS. The OS info is then added to another text document tempo1.txt and duplicated to tempo2.txt.
The final item gathered by our SysJoker sample was the system IP address. Once again, cmd.exe grabs this by querying wmic.exe. Output is saved to a different text file, tempi1.txt and copied to tempi2.txt.
The last action observed in our Threat Lab NetWitness stack was the Run registry key modification for persistence. Our SysJoker sample added the masquerading file igfxCUIService.exe to HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run. This will ensure that the malware runs every time a user logs on.
To assist cyber defenders with catching SysJoker in their Windows environments, we have created the following Application Rules:
Sysjoker Masquerades as Legit Service
Sysjoker - Get System Hardware Info
Sysjoker - Get Current Username
Sysjoker - Get System Software Info
Sysjoker - Get System IP Address
Sysjoker Modifies Registry for Persistence
All of these rules are currently available on NetWitness Live. We will continue to research both the Linux and MacOS variants and will provide updates on any developments or new content.
[i] https://www.intezer.com/blog/incident-response/new-backdoor-sysjoker/
[ii] https://blogs.vmware.com/security/2022/03/%e2%80%afsysjoker-an-analysis-of-a-multi-os-rat.html
[iii] https://bazaar.abuse.ch/browse.php?search=tag%3Asysjoker
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.