ESET researchers discover a malware family with tools that show signs they’re used in targeted attacks
ESET researchers have discovered a previously unknown malware family that utilizes custom and well-designed modules, targeting systems running Linux. Modules used by this malware family, which we dubbed FontOnLake, are constantly under development and provide remote access to the operators, collect credentials, and serve as a proxy server. In this blogpost, we summarize the findings published in full in our white paper.
To collect data (for instance ssh credentials) or conduct other malicious activity, this malware family uses modified legitimate binaries that are adjusted to load further components. In fact, to conceal its existence, FontOnLake’s presence is always accompanied by a rootkit. These binaries such as cat, kill or sshd are commonly used on Linux systems and can additionally serve as a persistence mechanism.
The sneaky nature of FontOnLake’s tools in combination with advanced design and low prevalence suggest that they are used in targeted attacks.
FontOnLake: Previously unknown malware family targeting Linux
The first known file of this malware family appeared on VirusTotal last May and other samples were uploaded throughout the year. The location of the C&C server and the countries from which the samples were uploaded to VirusTotal might indicate that its targets include Southeast Asia.
We believe that FontOnLake’s operators are particularly cautious since almost all samples seen use unique C&C servers with varying non-standard ports. The authors use mostly C/C++ and various third-party libraries such as Boost, Poco, or Protobuf. None of the C&C servers used in samples uploaded to VirusTotal were active at the time of writing – which indicates that they could have been disabled due to the upload.
FontOnLake’s currently known components can be divided into three following groups that interact with each other:
We discovered multiple trojanized applications; they are used mostly to load custom backdoor or rootkit modules. Aside from that, they can also collect sensitive data. Patches of the applications are most likely applied on the source code level, which indicates that the applications must have been compiled and replaced the original ones.
All the trojanized files are standard Linux utilities and each serves as a persistence method because they are commonly executed on system start-up. The initial way in which these trojanized applications get to their victims is not known.
Communication of a trojanized application with its rootkit runs through a virtual file, which is created and managed by the rootkit. As illustrated in Figure 1, data can be read/written from/to the virtual file and exported with its backdoor component upon the operator’s request.
Figure 1. Interaction of FontOnLake’s components
The three different backdoors we discovered are written in C++ and all use, albeit in slightly different ways, the same Asio library from Boost for asynchronous network and low-level I/O. Poco, Protobuf, and features from STL such as smart pointers are used as well. What is rare for malware is the fact that these backdoors also feature a number of software design patterns.
The functionality that they all have in common is that each exfiltrates collected credentials and its bash command history to its C&C.
Considering some of the overlapping functionality, most likely these different backdoors are not used together on one compromised system.
All the backdoors additionally use custom heartbeat commands sent and received periodically to keep the connection alive.
The overall functionality of these backdoors consists of the following methods:
We discovered two marginally different versions of the rootkit, used only one at a time, in each of the three backdoors. There are significant differences between those two rootkits; however, certain aspects of them overlap. Even though the rootkit versions are based on the suterusu open-source project, they contain several of FontOnLake’s exclusive, custom techniques.
Combined functionality of the two versions of the rootkit we discovered include:
Following our discovery while finalizing our white paper on this topic, vendors such as Tencent Security Response Center, Avast and Lacework Labs published their research on what appears to be the same malware.
All known components of FontOnLake are detected by ESET products as Linux/FontOnLake. Companies or individuals who want to protect their Linux endpoints or servers from this threat should use a multilayered security product and an updated version of their Linux distribution; some of the samples we have analyzed were created specifically for CentOS and Debian.
In the past we described an operation that shared certain behavioral patterns with FontOnLake; however, its scale and impact were much bigger. We dubbed it Operation Windigo and you can find more information about it in this white paper and this follow-up blogpost.
Additional technical details on FontOnLake can be found in our comprehensive white paper.
This table was built using version 9 of the ATT&CK framework.
|Initial Access||T1078||Valid Accounts||FontOnLake can collect at least ssh credentials.|
|Execution||T1059.004||Command and Scripting Interpreter: Unix Shell||FontOnLake enables execution of Unix Shell commands.|
|T1059.006||Command and Scripting Interpreter: Python||FontOnLake enables execution of arbitrary Python scripts.|
|T1106||Native API||FontOnLake uses fork() to create additional processes such as sshd.|
|T1204||User Execution||FontOnLake trojanizes standard tools such as cat to execute itself.|
|Persistence||T1547.006||Boot or Logon Autostart Execution: Kernel Modules and Extensions||One of FontOnLake’s rootkits can be executed with a start-up script.|
|T1037||Boot or Logon Initialization Scripts||FontOnLake creates a system start-up script ati_remote3.modules.|
|T1554||Compromise Client Software Binary||FontOnLake modifies several standard binaries to achieve persistence.|
|Defense Evasion||T1140||Deobfuscate/Decode Files or Information||Some backdoors of FontOnLake can decrypt AES-encrypted and serialized communication and base64 decode encrypted C&C address.|
|T1222.002||File and Directory Permissions Modification: Linux and Mac File and Directory Permissions Modification||FontOnLake’s backdoor can change the permissions of the file it wants to execute.|
|T1564||Hide Artifacts||FontOnLake hides its connections and processes with rootkits.|
|T1564.001||Hide Artifacts: Hidden Files and Directories||FontOnLake hides its files with rootkits.|
|T1027||Obfuscated Files or Information||FontOnLake packs its executables with UPX.|
|T1014||Rootkit||FontOnLake uses rootkits to hide the presence of its processes, files, network connections and drivers.|
|Credential Access||T1556||Modify Authentication Process||FontOnLake modifies sshd to collect credentials.|
|Discovery||T1083||File and Directory Discovery||One of FontOnLake’s backdoors can list files and directories.|
|T1082||System Information Discovery||FontOnLake can collect system information from the victim’s machine.|
|Lateral Movement||T1021.004||Remote Services: SSH||FontOnLake collects ssh credentials and most probably intends to use them for lateral movement.|
|Command and Control||T1090||Proxy||FontOnLake can serve as a proxy.|
|T1071.001||Application Layer Protocol: Web Protocols||FontOnLake acquires additional C&C servers over HTTP.|
|T1071.002||Application Layer Protocol: File Transfer Protocols||FontOnLake can download additional Python files to be executed over FTP.|
|T1132.001||Data Encoding: Standard Encoding||FontOnLake uses base64 to encode HTTPS responses.|
|T1568||Dynamic Resolution||FontOnLake can use HTTP to download resources that contain an IP address and port number pair to connect to and acquire its C&C. It can use dynamic DNS resolution to construct and resolve to a randomly chosen domain.|
|T1573.001||Encrypted Channel: Symmetric Cryptography||FontOnLake uses AES to encrypt communication with its C&C.|
|T1008||Fallback Channels||FontOnLake can use dynamic DNS resolution to construct and resolve to a randomly chosen domain. One of its rootkits also listens for specially crafted packets, which instruct it to download and execute additional files. It also both connects to a C&C and accepts connections on all interfaces.|
|T1095||Non-Application Layer Protocol||FontOnLake uses TCP for communication with its C&C.|
|T1571||Non-Standard Port||Almost every sample of FontOnLake uses a unique non-standard port.|
|Exfiltration||T1041||Exfiltration Over C2 Channel||FontOnLake uses its C&C to exfiltrate collected data.|