New Log4j Campaign Exploits Vulnerability for Crypto-Mining and System Compromise

On August 20, 2024, DataDog Security Labs released a comprehensive threat research report detailing a new opportunistic campaign leveraging the notorious Log4j vulnerability, also known as Log4Shell.

New Log4j Campaign Exploits Vulnerability for Crypto-Mining and System Compromise
The original image was generated by OpenAI's DALL-E and edited by the author. Source: OpenAI (August 2024)

Introduction

On August 20, 2024, DataDog Security Labs released a comprehensive threat research report detailing a new opportunistic campaign leveraging the notorious Log4j vulnerability, also known as Log4Shell. Despite being over two years old, this vulnerability continues to pose significant risks, as demonstrated by this latest attack aimed at crypto-mining and establishing persistent system control.

Report Overview

The Log4Shell vulnerability (CVE-2021-44228) was first discovered on November 24, 2021, by Security Researcher Chen Zhajun. This critical flaw in Apache Log4j, a widely used Java-based logging library, received the highest severity rating with a CVSS score of 10 out of 10. The vulnerability allows attackers to execute remote code, potentially compromising systems globally. Since its discovery, Log4Shell has been exploited by a range of threat actors, including nation-state groups like APT41 and cybercriminals such as the Conti ransomware gang.

On July 30, 2024, a honeypot deployed by DataDog Security Labs received an exploitation probe from a Tor exit node (185.220.101[.]34). The probe, initially appearing to be a standard Log4Shell attack, was later identified as part of a new campaign involving the deployment of the XMRig cryptocurrency miner.

The attack chain begins with an obfuscated LDAP request designed to evade detection. The request leads to the execution of a malicious Java class that downloads and runs a script named "lte." This script conducts system reconnaissance, retrieves system information, and establishes persistence through various means, depending on user privileges. The script also sets up multiple backdoors, including a reverse shell and encrypted communication channels, allowing remote control of the compromised system.

The script's execution flow includes downloading the XMRig miner, configuring it for crypto-mining, and ensuring its persistence by setting up system services or cron jobs. The script exfiltrates detailed system information to a remote server and attempts to evade detection by clearing command history and removing traces of its presence.

Insights and Analysis

The ongoing exploitation of Log4Shell in this campaign underscores the persistent threat posed by unpatched vulnerabilities. Organizations that have not yet applied mitigations for this vulnerability remain at risk of compromise, leading to potential data exfiltration, crypto-mining, and system control by malicious actors. The broader implications of this attack highlight the necessity for continuous monitoring and timely patching of known vulnerabilities.

The researchers at DataDog Security Labs emphasize the importance of not underestimating older vulnerabilities, as they continue to be exploited in new and evolving ways. This latest campaign serves as a reminder that opportunistic threat actors are constantly seeking unpatched systems to exploit for financial gain.
Organizations should prioritize the patching of the Log4Shell vulnerability if they haven't already done so. Additionally, implementing robust monitoring and detection capabilities is crucial to identifying and responding to such attacks promptly. Regularly reviewing and updating security controls, including those related to LDAP and JNDI, can further reduce the risk of exploitation.
The discovery of this new Log4j campaign by DataDog Security Labs illustrates the ongoing danger posed by unpatched vulnerabilities. The attack's sophisticated methods, including obfuscation, persistence mechanisms, and data exfiltration, highlight the need for vigilance in maintaining security hygiene. Organizations must act swiftly to mitigate these risks and protect their systems from similar threats.

Indicators of Compromise (IOC)

IndicatorTypeDescription
185.220.101[.]34IP AddressKnown Tor exit node used to probe for Log4Shell exploitation.
superr[.]buzzDomainDomain involved in the LDAP request for the attack.
cmpnst[.]infoDomainDomain used for XMRig cryptocurrency mining configuration.
nfdo[.]shopDomainDomain used to host malicious scripts and exfiltrate data.
e4edfa8c6891f6815c05e73852212207cc454a42496d1a109e750c660368b5c1File HashHash of the malicious script /tmp/lte.
5441be217e98051c284d584e830f9a7fc2153143fafee0dc9f6af197cec6c8c9File HashHash of the binary /bin/rcd.
2ac2877c9e4cd7d70673c0643eb16805977a9b8d55b6b2e5a6491db565cee1fFile HashHash of the cryptocurrency miner /bin/componist.
4f11db82193aebe710585b2faefd2b904b6fe6636f7dc25541cea0dd31adada4File HashHash of the binary /bin/nfdo.

MITRE ATT&CK Mapping

TacticTechniqueIDDescription
ExecutionCommand and Scripting InterpreterT1059The script uses curl, wget, and perl to download and execute malicious commands.
PersistenceCreate or Modify System ProcessT1543.003The script creates systemd services or cron jobs for persistence.
Defense EvasionClear Command HistoryT1070.003The script clears bash history to avoid detection.
ExfiltrationExfiltration Over Web ServiceT1567.002The script exfiltrates data via HTTP POST requests using curl.
Command and ControlEncrypted ChannelT1573The script sets up an encrypted reverse shell using GPG for communication.

Reference

The gift that keeps on giving: A new opportunistic Log4j campaign | Datadog Security Labs
In this post, we analyze a new opportunistic exploitation campaign based on the Log4j vulnerability.
CVE - CVE-2021-44228
The mission of the CVE® Program is to identify, define, and catalog publicly disclosed cybersecurity vulnerabilities.