In this post, we provide details of the SLUB backdoor, how it uses SaaS apps including Slack as a command and control channel, and how CASB controls can prevent this and similar threats from affecting the enterprise. For traditional firewalls and even for next-gen firewalls and intrusion detection/prevention systems, attacks like these are extremely insidious since they leverage allow listed services in a malicious way. Many enterprises use Slack day-to-day, and so an attack using a “known good” service may go undetected.
What is SLUB?
SLUB (SLack and GitHUB) is a backdoor, discovered and reported on by Cedric Pernet, Daniel Lunghi, Jaromir Horejsi, and Joseph C. Chen at Trend Micro. The malware was spread via a watering hole attack which exploited CVE-2018-8174. A downloader then retrieved the SLUB backdoor and executed it by exploiting CVE-2015-1701, a vulnerability in the Windows operating system which provided SYSTEM-level privileges. Trend concluded that this was likely the work of an advanced persistent threat actor due to the sophistication of both the attack vector and the malware.
The malware is notable for its ability to evade traditional network intrusion detection systems by leveraging common SaaS applications such as Slack, Github, and File.io.
What are its capabilities?
The SLUB backdoor maintains persistence by setting a registry key named “Microsoft Setup Initializazion” (yes, the spelling of initialization is incorrect in the file) in SOFTWARE\Microsoft\Windows\CurrentVersion\Run, naming itself “Windows-RT-KB2937636.dll”. It uses the rundll32 application to execute the main program logic, which is contained in the “UpdateMPUnits” function.
The malware has a suite of functions that are run based on the contents of a GitHub gist which it retrieves through use of the statically-linked Curl library. It then uses the Boost library (also statically linked) to parse the commands from the Github gist.
When the malware “wakes up”, it will make its initial call out to an attacker-controlled Slack workspace with the victim’s computer name and username. This same Slack workspace is used for posting the responses and results of every command received via the Github gist, using Curl and the statically-linked JsonCpp library. This is a critical channel for the attacker since it gives them a pulse on the infected machines, allowing them to keep inventory, have an idea of whether or not their commands are successful, and when querying for information, Slack is the lifeline which provides it back to them.
File uploads also rely on the curl library and are sent to an attacker-controlled bucket on file.io.
Figure 1 – disassembly showing Slack token.
exec – Execute instruction
Leverages cmd.exe to run instructions on the target system. It will write a log file of the format “%ws\%u_cmd_out.tmp” during execution where output is written, as well as a similarly named .dat file in some cases. The files are deleted at the end of the command execution and a message indicating success or failure is posted to the attacker’s Slack workspace.
dnexec – Download and execute
Here, a file is downloaded and executed using CreateProcessW. If the process fails to run or once the thread has completed execution, the file is deleted and a message is posted to the attacker’s Slack workspace.
update – Download a file, run it, and delete the old file
This functionality “updates” a file, by downloading a new attacker-specified file, deleting the old version, and running the new file. A message indicating completion or failure is posted to the attacker’s Slack workspace.
destroy – Cover your tracks
When SLUB receives the destroy command, it will move to cover its tracks. Through a series of commands, it will remove any trace of itself from the user’s system, deleting the registry key and the dll that serves as the main program logic. When initiated, a message is posted in the Slack workspace identifying the machine and user which will have the malware deleted.
file – Exfiltrate files
This is the main use of File.io and one of the noteworthy uses of Slack in the SLUB backdoor. The files are uploaded to File.io via Curl and the REST API. In an effort to evade traditional IDS/IPS, SLUB uses Curl to interact with the Slack “postMessages” API and an embedd