Cybersecurity researchers at Intezer spotted a new completely undetectable Linux malware, dubbed Doki, that exploits undocumented evasion techniques while targeting publicly accessible Docker servers.
The ongoing Ngrok mining botnet campaign is targeting servers are hosted on popular cloud platforms, including Alibaba Cloud, Azure, and AWS.
“Ngrok Mining Botnet is an active campaign targeting exposed Docker servers in AWS, Azure, and other cloud platforms. It has been active for at least two years.” reads the report published by Intezer. “We have detected a recent attack which includes a completely undetected Linux malware and a previously undocumented technique, using a blockchain wallet for generating C&C domain names.”
The botnet is scanning the Internet for misconfigured Docker API endpoints, Experts noticed that the Ngrok malware has already infected many vulnerable servers.
The Ngrok mining botnet has been active for the past two years, its operators primarily focused on abusing misconfigured Docker servers to set up containers running cryptominers.
The researchers pointed out that the Doki is a new multi-threaded malware leverages an undocumented technique for C2 communications by abusing the Dogecoin cryptocurrency blockchain in a unique way.
“Doki uses a previously undocumented method to contact its operator by abusing the Dogecoin cryptocurrency blockchain in a unique way in order to dynamically generate its C2 domain address.” continues the report. “The malware has managed to stay under the radar for over six months despite samples being publicly available in VirusTotal.”
The botnet uses zmap, zgrap, and jq to scan the network and ports associated with Redis, Docker, SSH, and HTTP.
The malicious script includes a list of hardcoded ranges of IP addresses that belong to cloud servers such as AWS and local cloud providers in foreign regions (i.e. China, Austria, and the United Kingdom).
The downloader script allows operators to download and install various malware binaries, including cryptominers. Experts noticed that the script can install a fully undetected backdoor, dubbed by the researchers Doki.
The malware uses the embedTLS library for cryptographic functions and network communication.
The malware is able to execute commands from its operators, it leverages a Dogecoin cryptocurrency block explorer to dynamically generate its C2 domain in real-time.
“The malware starts by generating a C2 domain using its unique DGA.” state the researchers. “In order to construct the C2 address the malware performs the following steps:
The malware uses the DynDNS service and a unique Domain Generation Algorithm (DGA) based on the Dogecoin cryptocurrency blockchain to find the domain of its C2 in real-time.
Attackers also created containers that are configured to bind /tmpXXXXXX directory to the root directory of the hosting server. Using this trick, threat actors can access and modify every file on the server’s filesystem from within the container.
The bind configuration allows the attacker to control the cron utility to modify the host’s cron to execute the downloaded payload every minute.
“This attack is very dangerous due to the fact the attacker uses container escape techniques to gain full control of the victim’s infrastructure.” concludes the report. “Our evidence shows that it takes only a few hours from when a new misconfigured Docker server is up online to become infected by this campaign.”
If you run Docker instances, you have to avoid to expose docker APIs online if possible or limit the access to trusted users from a trusted network or VPN.
(SecurityAffairs – hacking, Doki)