×
Community Blog Cloud-based Mining Botnet Trends in 2019: Mining Trojans Spreading as Worms

Cloud-based Mining Botnet Trends in 2019: Mining Trojans Spreading as Worms

This article provides an in-depth analysis of the trends of mining trojans observed in 2019 based on the long-term monitoring data of the Alibaba Cloud Security team.

By Sangduo
Special thanks to Cangpo and Wufan

A mining trojan is a type of trojan that exploits vulnerabilities to intrude into computers and implants mining software to mine encrypted digital currencies for profit. Compromised computers may experience increases in CPU usage, system lag, and business service failures. To remain on servers for a long time, mining trojans use a variety of methods to compromise server security, such as modifying scheduled tasks, firewall configurations, and system dynamic-link libraries, which may cause service interruption on the target server.

Mining trojans first appeared in 2012. The price of encrypted digital currencies has soared since 2017 and the computing resources of servers can be put to better use due to the emergence of anonymous coins such as Monero, which are untraceable and immune against ASIC miners. Mining trojans have been a major security threat on the Internet since 2018. The Alibaba Cloud Security Team has been tracking and studying mining trojans for a long time. In 2019, we detected outbreaks of many mining trojans, some of which showed new development trends. This article analyzes and summarizes the trends of mining trojans observed in 2019 based on our long-term monitoring data.

Status Quo

  • A total of 80 major cybercrime groups with mining botnets were detected in 2019, with Linux servers as the main attack target.
  • At present, trojans are spread as worms. An attack is often mounted through the exploitation of multiple vulnerabilities.
  • Illicit cryptocurrency miners spread trojans through brute-force attacks. Weak passwords are still the main threat on the Internet.
  • Improper security configurations of non-web basic frameworks and components offer a new opportunity to spread mining trojans.
  • Cybercrime groups frequently exploit common N-day vulnerabilities to spread mining botnets. This shortens the window during which users must fix N-day vulnerabilities.
  • Enterprises must develop more professional response capabilities to security emergencies to deal with mining trojans that use increasingly sophisticated methods to compromise security and contend for resources.

Overall Situation

A total of 80 major cybercrime groups spreading mining trojans were detected in 2019. The following figure and table respectively show the top 10 most active trojan families and their profiles, where the activity of the trojans is measured by their total number of victims. Among compromised hosts, 69% use Linux operating systems and 31% use Windows. The top 10 most active trojan families primarily target Linux operating systems.

1

Family name Description Platform Attack method
DDGS A mining botnet based on the Go language. It first appeared in October 2017. Linux SSH cracking and Redis cracking
MinerGuard A mining botnet based on the Go language. It appeared in April 2019. Windows and Linux SSH cracking, Redis cracking, SQL Server cracking, and multiple web service vulnerabilities such as Elasticsearch, WebLogic, Spring, and ThinkPHP vulnerabilities
h2Miner It appeared in December 2019. Linux SSH cracking, Redis cracking, and multiple web service vulnerabilities
Kworkerds A rootkit mining worm. It first appeared in September 2018. Linux and Windows SSH cracking, Redis cracking, and WebLogic remote code execution (RCE) vulnerability
Bulehero A mining worm virus on Windows. It first appeared in August 2018. Windows WannaCrypt vulnerability, Inter-process Communication shares (IPC$) cracking, and multiple web service vulnerabilities such as Apache Struts 2 RCE and ThinkPHP RCE vulnerabilities
Kerberods A mining botnet that appeared in April 2019. Linux SSH cracking, Redis cracking, and web service vulnerabilities such as the Confluence RCE vulnerability
8220 Miner A long-active Chinese cybercrime group that exploits multiple vulnerabilities and deploys mining programs. It was first exposed in August 2018. Linux and Windows Multiple web service vulnerabilities, such as the unauthorized access vulnerability of Hadoop YARN and that of Docker
Watchdog A mining worm on Linux. It broke out in February 2019. Linux SSH cracking, Redis cracking, and multiple web service vulnerabilities
sobotMiner It broke out in June 2019. Linux SSH cracking, Redis cracking, and web service vulnerabilities such as the Confluence RCE vulnerability
CryptoSink A mining worm on Windows and Linux. It was first exposed in March 2019. Windows Command execution vulnerability (CVE-2014-3120) of Elasticsearch

2

Attack Trends

1. At present, mining trojans are spread as worms, and an attack is often mounted through the exploitation of multiple vulnerabilities. A number of extensive RCE vulnerabilities were exposed in 2019. An N-day vulnerability is difficult to fix in a short time after exposure and may quickly be exploited by hackers to spread mining trojans and botnets. In 2019, we found a number of events where common vulnerabilities were exploited by illicit cryptocurrency miners. The following figure shows the timeline from exposure to exploitation of some vulnerabilities. Most of the vulnerabilities were exploited by illicit cryptocurrency miners in a period ranging from a few days to a dozen days. This poses a severe challenge to the rapid response capabilities of cloud platforms and users.

3

2. At present, trojans are spread as worms, and an attack is often mounted through the exploitation of multiple vulnerabilities. The top 10 most active mining trojans are spread as worms (except 8220 Miner) and exploit more than two vulnerabilities (except CryptoSink). This means that mining trojans are spread in a more effective and extensive manner. If the information system of an enterprise contains a vulnerability prone to arbitrary exploitation, the enterprise's internal network may be soon compromised after the security boundary is broken. The enterprise must develop comprehensive vulnerability defense capabilities to deal with the leaky bucket effect that occurs when single-point defense fails.

3. Illicit cryptocurrency miners spread trojans through brute-force attacks. Weak passwords are still the main threat on the Internet. The following figure shows the percentages of different applications that are compromised for cryptocurrency mining. Redis, SSH, SQL Server, and RDP are still the main targets. Weak passwords are widely used on the Internet due to the insufficient security awareness of O&M engineers. Brute-force attacks are easy to launch and have become an important means of spreading mining trojans.

4

4. Improper security configurations of non-web basic frameworks and components offer a new opportunity to spread mining trojans. New technologies such as big data and containers have been widely used in recent years, and enterprises have begun to deploy their development and test environments on the cloud after cloud migration. This exposes service configurations to security threats because enterprises lack professional security engineers and technical engineers lack security awareness. For example, services are exposed to the Internet, interfaces lack authentication and use weak passwords, and N-day vulnerabilities are exposed. Vulnerable applications are typically the non-core businesses of an enterprise and therefore do not receive as much investment as web applications in terms of security hardening and vulnerability fixing. Vulnerable applications are often provided through non-standard ports or use non-HTTP protocols and cannot be fully protected by local security policies. Mining trojans have been spread through big data and container components since 2018. Container orchestration and supply chain frameworks and components have been the targets of mining trojan attacks since 2019. The following table lists the vulnerabilities of non-web basic frameworks and components that have been exploited by mining trojans.

Vulnerability Application Scenario
RESTful API unauthorized access vulnerability of Hadoop YARN Hadoop YARN Big data
RESTful API unauthorized access vulnerability of Spark Spark Big data
Unauthorized access vulnerability of Elasticsearch Elasticsearch Big data
Remote API unauthorized access vulnerability of Docker Docker Container
API server unauthorized access vulnerability of Kubernetes Kubernetes Container orchestration
Jenkins RCE (CVE-2019-1003000) Jenkins Supply chain
Unauthorized RCE vulnerability of Confluence Confluence Supply chain
RCE vulnerability of Nexus Repository Manager 3 Nexus Repository Supply chain

Trends in Attack Methods

After successful intrusion, a mining trojan may use multiple methods to compromise security and prevent security systems from detecting and removing it. This allows the trojan to mine virtual currencies in a stable and long-term manner. Mining trojans have to use multiple methods to compete for resources. We observed increasingly sophisticated methods of security compromise and resource contention used by mining trojans in 2019. The following lists the major methods used by mining botnets.

1. Security Compromise

  • Fileless Attack

A fileless attack is mounted without implanting malicious software into disks, so it can bypass static scanning by antivirus software. Therefore, fileless attacks are difficult for antivirus software to detect and defend against. In mining botnets, Windows Management Instrumentation (WMI) is accessed by calling APIs provided by various tools (such as the WMI command line tool wmic.exe on Windows) or scripting languages (such as PowerShell), to launch fileless attacks. TheHidden uses wmic.exe to launch a fileless attack through the following code:

5

  • Rootkit

A mining trojan obtains profits through its long-term residence on the target server. Rootkit is the general term for malicious residence techniques. The most common technique for malicious long-term residence is to write scheduled tasks. The preloaded rootkits of dynamic-link libraries were widely used by mining trojans in 2019. Mining trojans hook common functions, such as readdir in libc, through the preloading mechanism of dynamic-link libraries. Malicious processes are hidden when shell commands such as ps and top are used to read process information from the /proc/ directory. The following figure shows how 8220 Miner hides rootkits through ProcessHider.

6

  • Central Control

In a central control attack, the hacker runs a backdoor on the compromised host, and the backdoor regularly communicates with the hacker-manipulated central control server, allowing the hacker to send commands to and steal data from the compromised host. Bots do not need to be strongly controlled during malicious cryptocurrency mining. Therefore, most mining trojans do not have a complete central control module. Instead, hackers often use configuration files and scheduled tasks to modify bot configurations and upgrade bot versions. However, an increasing number of mining botnets have resorted to central control since 2019 to gain greater advantages in resource contention. The following figure shows some central control modules of h2Miner.

7

  • Dark Web

Mining botnets put their servers on the Dark Web and The Onion Router (Tor), making it more difficult to trace mining trojans and botnets. The Dark Web has been widely exploited by mining botnets since 2019. The following figure shows the attack process of the illicit cryptocurrency miner called Xulu that broke out in May 2019, which hides its control server on TOR.

8

2. Resource Contention

  • Kill Competing Processes

A mining botnet detects other mining processes based on process fingerprint libraries, or directly kills processes with high CPU usage. The following figure shows some fingerprint libraries used by h2Miner, which uses more than 460 process fingerprints. This is one of the reasons for the sudden rise of h2Miner in December 2019.

9

  • Modify Firewall Configurations

Mining bots modify the iptables of firewalls and disable vulnerable service ports to block other mining trojans. Alternatively, mining bots disable common mining pool ports to block the cryptocurrency mining of competitors.

10

  • Sinkhole

Sinkhole is a method used by a security engineer to resolve a malicious domain name to an invalid IP address. Mining botnets use Sinkhole for resource contention and resolve the domain names of competitors and common mining pools to invalid IP addresses by modifying /etc/hosts. This blocks the cryptocurrency mining of competitors. The following malicious code allows a mining botnet to resolve the domain name of a competitor to an invalid IP address through Sinkhole.

11

Examples of Typical Botnets

A number of major cybercrime groups that used mining trojans emerged in 2019. They mounted extensive attacks in unprecedented ways.

  • Watchdog (appeared in February): This worm has been frequently upgraded and has constantly added the latest vulnerabilities to its arsenal. It was spread through the latest RCE vulnerability of Nexus Repository Manager in February 2019 and through the latest remote command execution vulnerability of Solr Velocity template injection in early November 2019.
  • MinerGuard (appeared in April): This trojan uses a variety of complex attack methods and provides comprehensive process protection modules.
  • Kerberods (appeared in April): This trojan spread through the RCE vulnerability of Confluence and used multiple persistence-based attack methods.
  • h2Miner (appeared in December): This trojan spread widely through the RCE vulnerability of Redis 4.x and was the most active mining trojan at the end of 2019 due to its great advantages in resource contention derived from its powerful library of competing process fingerprints.

Many long-standing illicit cryptocurrency miners constantly upgraded their attack methods and extensively spread mining trojans in 2019.

  • DDGS: This botnet upgraded its communication module for central control in January and then again in November. It upgraded from a central control structure to a non-central P2P structure, to completely hide its hacker-manipulated central control server.
  • Bulehero: This worm was frequently upgraded in 2019 to add the latest attack methods to its arsenal. It was spread through the latest backdoor vulnerability of PHPStudy in early October and upgraded its file naming method to enhance its resource competitiveness.

1. h2Miner

h2Miner is a Linux-targeting mining botnet that intrudes through Redis cracking and exploits multiple web service vulnerabilities. We detected h2Miner as early as December 5 and named it after h2.sh, a malicious shell script. Its activity was low until December 18, when it broke out and became the most active mining botnet on the Internet in just five days, overtaking DDGS and MinerGuard.

The h2Miner outbreak was due to its new method of Redis intrusion. After Redis cracking, h2Miner initiates privilege escalation by exploiting the RCE vulnerability of Redis 4.x rather than writing scheduled tasks (which is the common method). This allows h2Miner to bypass the security configuration of Redis. Pavel Toporkov expounded h2Miner's new attack method at the international cybersecurity conference ZeroNights 2018. Redis added a new module feature in versions later than Redis 4.x, allowing you to load the so file compiled by the C language to run specific Redis commands. The following figure shows the activity trends of h2Miner before and after its outbreak.

12

The following figure shows the attack process of h2Miner. An attacker loads the red2.so malicious file by exploiting the RCE vulnerability of Redis 4.x to run a malicious command for downloading and running a malicious script. This script is used to download the malicious binary file named kinsing to receive hacker commands from the central control server. This helps mount attacks and spread the worm. The downloaded malicious script also removes a large number of competitors. The fingerprint library used contains 460 fingerprints of competing processes. This contributes to the rapid outbreak of h2Miner. As shown in the preceding figure, DDGS and MinerGuard experienced a big drop in activity on December 18 when h2Miner broke out on a large scale.

13

2. DDGS

The DDGS mining botnet was first exposed in October 2017. It exploited the vulnerability of OrientDB early on and now resorts to the unauthorized access vulnerability of Redis and the weak password vulnerability of SSH for intrusion. The following figure shows the DDGS attack process. After intruding into a host, DDGS downloads the i.sh malicious script and DDGS program. Then, DDGS runs the disable.sh script to remove other mining programs, starts its mining program after communicating with the hacker-manipulated central control server, and intrudes into other hosts.

14

DDGS has been frequently upgraded since 2019, from 301X to 4008. It recently exploited the RCE vulnerability of Nexus as a minor attack method. DDGS updated its central control protocol twice in 2019, from a central control structure to a full P2P structure.

In DDGS 3014 and earlier versions, the IP address of the central control server is hard-coded in malicious files, which made it easy to track by security engineers.

In DDGS 3015 released in January 2019, the compromised host uses the Memberlist protocol framework to build a P2P network, where the real central control server is hidden. The compromised host needs to use the protocol to traverse the P2P network members to locate the real central control server. However, communication with the central control server was still centralized. Security engineers could simulate the compromised host to obtain the real IP address of the central control server.

DDGS was upgraded to the 4008 version in November 2019. In this version, DDGS listens to a random port of the compromised host and forwards communication packets to P2P network members through net.Pipe() of Golang. This means no direct communication exists between the compromised host and the central control server. The communication packets can be routed to the real central control server through other compromised hosts. The IP address of the central control server is hidden in an anonymous structure similar to TOR. The following figure shows the central control structures of the different DDGS versions.

15

16

3. MinerGuard

MinerGuard is a mining botnet targeting Windows and Linux and exploits the unauthorized access vulnerability of Redis, the weak password vulnerability of SSH, and multiple web service vulnerabilities. It broke out in April 2019. MinerGuard uses the same program logic on different platforms and runs the sysguard, networkservice, and sysupdate malicious files on the compromised host.

The networkservice file is the attack module of MinerGuard, which exploits multiple web service vulnerabilities. The sysupdate module is an open-source Monero mining program that loads miner parameters from config.json. The sysguard module updates the IP address of the central control server and ensures that the virus persistently resides on the server. After the sysguard module starts, four threads are created to update the IP address of the central control server, protect startup items, start the daemon process, and upgrade versions, respectively. The sysguard module provides comprehensive protection, allowing MinerGuard to rank third among mining botnets.

17

4. Bulehero

The Bulehero mining worm appeared in early 2018 and was first exposed in August 2018. Its name is derived from the domain name bulehero.in that was initially used by this worm. Bulehero targets Windows servers and makes profits by implanting malicious mining software. Bulehero spreads by using multiple complex attack methods. It has been frequently upgraded since it appeared and constantly adds new attack methods to its arsenal.

After the backdoor vulnerability of PHPStudy was exposed on September 20, 2019, Bulehero was spread by exploiting this vulnerability in about a dozen days. The following figure shows the attack process of Bulehero. The attack payload downloads the download.exe file, which is used to download the attack module, scan module, and mining module for worm propagation and malicious mining. The malicious files of the three modules were hidden by disguising the file names as system file names before the latest upgrade. Now they are changed to random file names. The random file names make it easy for O&M engineers to identify and clear the malicious files, but prevent competitors from creating process fingerprints. This gives Bulehero an edge in resource contention.

18

5. Kworkerds

Kworkerds is a mining botnet that targets Windows and Linux and exploits the unauthorized access vulnerability of Redis, the weak password vulnerability of SSH, and multiple web service vulnerabilities such as the WebLogic RCE vulnerability. It broke out in September 2018. Kworkerds is highly active. Its malicious file URL is frequently changed, but its code structure has not been significantly changed. Kworkerds can exploit a vulnerability to download and run the mr.sh/2mr.sh malicious script and implant mining programs. Kworkerds implants rootkit backdoors by hijacking dynamic-link libraries.

19

6. Kerberods

Kerberods is a mining worm targeting Linux. It was widely spread by exploiting the RCE vulnerability (CVE-2019-3396) of Confluence in April 2019. The following figure shows its spreading process. Kerberods provides a persistence module that uses three methods of persistence: (1) write the /etc/init.d/netdns file to start the malicious daemon process; (2) write /usr/local/lib/libpamcd.so to hook all system functions; (3) write the command used to download malicious programs to the cron file for scheduled execution. Reverse engineering of malicious files shows that the techniques, program structure, and infrastructure used by Kerberods are similar to those used by Watchdog, which exploits Redis vulnerabilities. Therefore, Kerberods and Watchdog may have been created by the same person.

20

7. 8220 Miner

8220 Miner was first exposed in August 2018 and invariably uses Port 8220. It is the first mining trojan that exploits the unauthorized access vulnerability of Hadoop YARN and it also exploits multiple web service vulnerabilities.

The following figure shows the attack process of 8220 Miner, which runs the mr.sh script to execute the mining program after intrusion. 8220 Miner mounts network-wide attacks by using a group of fixed IP addresses, rather than by spreading worms. We have tracked 8220 Miner for a long time and found that most of its IP addresses are located in Southeast Asia. 8220 Miner was the most active mining trojan in 2018, but showed few signs of new activities by the second half of 2019. We speculate that 8220 Miner failed in resource contention because it does not spread worms but uses simple malicious files. We expect 8220 Miner to disappear gradually if no more major upgrades are made to it.

21

8. Watchdog

Watchdog is a Linux-targeting mining worm that broke out in February 2019 by exploiting the RCE vulnerability of Nexus Repository Manager. The following figure shows the attack process of Watchdog. Watchdog has been frequently upgraded since it appeared. In July 2019, it added multiple attack methods to exploit web service vulnerabilities. In this upgrade, Watchdog also gained a built-in scan module specific to the RCE vulnerability (CVE-2019-0708) of Windows RDP. If this vulnerability is detected on the scanned host, the host address is returned to the central control server in RC4 encryption mode. Attackers may be using this botnet to detect vulnerable hosts on the Internet in preparation for attacks against Windows operating systems.

22

Security Recommendations

When we prepared this report in January 2020, virtual currencies experienced a new round of appreciation. This may attract more hackers to make profits through malicious mining, which is expected to run rampant in 2020.

Based on our estimates, the Alibaba Cloud Security Team provides the following security recommendations for cloud users:

  • More than half of mining trojans exploit weak password vulnerabilities. These vulnerabilities exist due to insufficient security awareness. Enterprises' primary measure should be to strengthen their security awareness education and security management.
  • Illicit cryptocurrency miners may exploit zero-day or N-day vulnerabilities during the period from when the vulnerability is exposed until it is fixed. This requires enterprises to improve their emergency response efficiency, monitor product security advisories in real time, and perform prompt upgrades. Enterprises can also purchase managed security services to improve security.
  • Enterprises tend to focus on their core business and make security investments accordingly. For example, enterprises may deploy Web Application Firewall (WAF) and Anti-DDoS Pro to protect their core web services, but expose non-web network applications available on the Internet to security threats. Security O&M engineers must pay attention to the security threats against non-web applications or purchase firewalls with an intrusion prevention system (IPS) function to defend against zero-day vulnerabilities.
0 0 0
Share on

Alibaba Cloud Security

32 posts | 15 followers

You may also like

Comments