The malware is written in C++ and each sample is tailored for the specific operating system it targets.
Both the macOS and Linux samples are fully undetected in VirusTotal.
ysJoker’s behavior is similar for all three operating systems. analysts will analyze SysJoker’s behavior on Windows.
Unlike Mac and Linux samples, the Windows version contains a first-stage dropper. The dropper (d71e1a6ee83221f1ac7ed870bc272f01) is a DLL that was uploaded to VirusTotal as style-loader.ts and has only 6 detections at the time of this writing.
The Dropper drops a zipped SysJoker (53f1bb23f670d331c9041748e7e8e396) from C2 https[://]github[.]url-mini[.]com/msg.zip, copies it to C:ProgramDataRecoverySystemrecoveryWindows.zip, unzips it and executes it. All of these actions are executed via PowerShell commands.
Once SysJoker (d90d0f4d6dad402b5d025987030cc87c) is executed it sleeps for a random duration between 90 to 120 seconds. Then, it will create the C:ProgramDataSystemData directory and copy itself under this directory, masquerading as igfxCUIService.exe (igfxCUIService stands for Intel Graphics Common User Interface Service). Next, it will gather information about the machine using Living off the Land (LOtL) commands.
SysJoker uses different temporary text files to log the results of the commands. These text files are deleted immediately, stored in a JSON object, and then encoded and written to a file named microsoft_windows.dll.
It will gather the MAC address, user name, physical media serial number, and IP address (see IoCs section for the full commands list). SysJoker will create persistence by adding an entry to the registry run key HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun. Between each of the steps above, the malware sleeps for a random duration.
Next, SysJoker will begin its C2 communication.
SysJoker holds within the binary a hardcoded XOR key which is used for decoding and encoding strings from within the binary and data sent and received from the C2. The XOR key is an RSA public key that is not used in the decoding scheme.
The same XOR key exists in all versions of SysJoker:
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDkfNl+Se7jm7sGSrSSUpV3HUl3vEwuh+xn4q
BY6aRFL91x0HIgcH2AM2rOlLdoV8v1vtG1oPt9QpC1jSxShnFw8evGrYnqaou7gLsY5J2B06eq5UW7
+OXgb77WNbU90vyUbZAucfzy0eF1HqtBNbkXiQ6SSbquuvFPUepqUEjUSQIDAQAB
The Google Drive link hosts a text file named domain.txt that holds an encoded C2. The text file’s content changes over time, depending on the current available C2. SysJoker will decode the C2 and send the collected user’s information to the C2’s /api/attach directory as an initial handshake.
The C2 replies with a unique token which will be used as an identifier from now on when the malware communicates with the C2.
SysJoker runs a while(1) loop that sends a request to the C2’s /api/req directory with the unique token and will process the C2’s response which is built as JSON using functions from this library.
If the server responds with data, SysJoker will parse the received payload (see step 3 in the image below). SysJoker can receive the following instruction from the C2: exe, cmd, remove_reg, and exit.
remove_reg and exit are not implemented in this current version. Based on the instruction names, analysts can assume that they are in charge of self-deletion of the malware. Let’s look into exe and cmd instructions:
exe – This command is in charge of dropping and running an executable.
SysJoker will receive a URL to a zip file, a directory for the path the file should be dropped to, and a filename that the malware should use on the extracted executable.
It will download this file, unzip it and execute it.
After execution, the malware will reply to the C2’s /api/req/res API with either “success” if the process went successful or “exception” if not.