Key takeaways:
TeamTNT is using new, open source tools to steal usernames and passwords from infected machines.
The group is targeting various operating systems including: Windows, different Linux distributions including Alpine (used for containers), AWS, Docker, and Kubernetes.
The campaign has been active for approximately one month and is responsible for thousands of infections globally.
Many malware samples still have zero antivirus (AV) detections and others have low detection rates.
Analysis of components used in the “Chimaera” campaign
New credentials stealer (“Lazagne” component)
The malicious script starts its activity by modifying the bash history file. This hides any future commands executed from users using the “history” command on Linux.
The script then installs its dependencies (‘curl’, ‘bash’, ‘wget’, ‘pip’, ‘py3-pip’, ‘python3-pip’).
Supported operating systems include different Linux distributions, such as Alpine Linux which is typically used in containers.
Once the malware is finished with its “pre-setup,” it downloads the second phase of the attack from its C&C, which includes another bash script (‘run.sh’) along with the Lazagne project.
Lazagne is an open-source project available for different operating systems (Windows, Linux, and MacOS). Its developer describes the Lazagne tool as an application that can be used to retrieve multiple passwords stored on a local machine. Due to its capabilities, the tool has been added as a post exploitation module to the pupy project.
It supports a wide range of programs, such as browsers (Chrome, Firefox, Opera, etc.), Sysadmin programs (such as CoreFTP, Putty, OpenSSH, etc. ), Wifi password, mail programs, databases, etc. The full list of supported programs can be found on the Lazagne page on Github.
In this phase two of the attack, the second malicious script executes the Lazagne tool, saves its output into “laZagne.out.txt,” and uploads it to the C&C using the curl command. At the end of the execution, the malware deletes any file that has been downloaded.
Windows component – Set up a cryptocurrency miner
For Windows operating systems, the attackers use a malicious script that downloads all the tools required for unpacking and executing the Xmrig miner.
This includes the 7z tool for decompressing downloaded files and Nssm to add the miner as a service.
The malware will setup the miner and then the miner will persist it in the system in two ways:
1) by adding itself as a service if the malware gains admin privileges or
2) by adding the batch file to the startup folder.
Kubernetes root payload component
This component is mainly responsible for installing a cryptocurrency miner on infected devices, allowing the attacker to connect remotely to the system using SSH.
The malicious script uses the following steps to achieve its goal:
Disabling or uninstalling security products on infected machines, such as Aegis Authenticator, quartz, and Alibaba services (AliSecGuard, AliYunDun, AliNet etc.).
Adding the attacker’s RSA-key to the list of known SSH host (allowing the attacker to connect the machine through SSH without the need of user/password in the system).
Installing missing required tools for crypto mining.
Modifying the host file.
Setting up the XMRig crypto miner.
Adding persistence for the XMR miner.
Removing itself.
TeamTNT AWS stealer
Similar to the other TeamTNT components, the AWS stealer first installs missing dependencies. It then collects information from infected devices and stores the informaiton in a temporary file “/var/tmp/TeamTNT_AWS_STEALER.txt”.
This information includes:
AWS default region
AWS access key Id
AWS secret access key
AWS session token
AWS user credentials
AWS root credentials
Shared credentials file
Container credential relative URI
When finished, the malware uploads all of the stored information to its C&C using curl command, and then it cleans up its traces.