A Cryptomining botnet abuses Bitcoin blockchain transactions as C2 backup mechanism

Crooks are exploiting BTC blockchain transactions to hide backup command-and-control (C2) server addresses for a cryptomining botnet.

Security experts from Akamai have spotted a new botnet used for illicit cryptocurrency mining activities that are abusing Bitcoin (BTC) transactions to implement a backup mechanism for C2. 

This technique allows botnet operators to make their infrastructure resilient to takedown conducted by law enforcement. 

“A recent piece of malware from a known crypto mining botnet campaign has started leveraging Bitcoin blockchain transactions in order to hide its backup C2 IP address. It’s a simple, yet effective, way to defeat takedown attempts.” reads the post published by Akamai. “Recent infection attempts against Akamai SIRT’s custom honeypots uncovered an interesting means of obfuscating command and control (C2) infrastructure information. The operators of a long-running crypto-mining botnet campaign began creatively disguising their backup C2 IP address on the Bitcoin blockchain.”

The infection chain begins the exploitation of a Remote Code Execution (RCE) vulnerabilities affecting Hadoop Yarn, Elasticsearch (CVE-2015-1427), and ThinkPHP (CVE-2019-9082). 

Botnet operators used Redis server scanners to find installs that could be compromised to mine cryptocurrencies. 

The experts estimated that botnet operators have mined more than $30,000 in Monero in public pools since 2018. Experts identified multiple variants over the time, using different techniques and tools.

The older versions were using a shell script to carry out the main functions, such as disabling security features, killing off competing infections, establishing persistence, and in some cases, propagating within the compromised network.  

Newer variants of the shell script leverage binary payloads for handling more system interactions, like killing off competition, disabling security features, modifying SSH keys, downloading, and starting the miners.

Botnet operators use cron jobs and rootkits to achieve persistence and re-infect with the latest version of the malware.

“These methods rely on domains and static IP addresses written into crontabs and configurations.  Predictably these domains and IP addresses get identified, burned, and/or seized. The operators of this campaign expected this and included backup infrastructure where infections could fail over and download an updated infection that would, in turn, update the infected machine to use new domains and infrastructure.” continues the report.

“While this technique works, a coordinated takedown effort that targets domains and failover IP address/infrastructure all at once could effectively cut the operators out of maintaining their foothold on infected systems.”

In December 2020, the researchers discovered a BTC wallet address that was included in new variants of the miner, along with an URL for a wallet-checking API and bash one-liners. The experts discovered that the wallet data were being fetched by the API and used to calculate an IP address used to maintain persistence.

By fetching addresses via the wallet API, botnet operators are able to obfuscate and backup configuration data on the blockchain. 

Experts noticed that by pushing a small amount of BTC into the wallet, operators can recover infected systems that have been orphaned.

“Essentially, the infection is using the wallet address as a DNS like record, and the transaction values as a type of A record. the variable aa contains the Bitcoin wallet address, variable bb contains the API endpoint that returns the latest two transactions used to generate the IP address, and variable cc contains the final C2 IP address after the conversion process is completed.” continues the report. “To achieve this conversion, four nested Bash one-liners (one each, per-octet) are concatenated together.”

bitcoin botnet

Experts believe the technique can be improved to avoid providing pointers and feedback to the botnet developers.

“Adoption of this technique could be very problematic, and it will likely gain popularity in the near future.” concludes the report.

If you want to receive the weekly Security Affairs Newsletter for free subscribe here.

Pierluigi Paganini

(SecurityAffairs – hacking, botnet)

The post A Cryptomining botnet abuses Bitcoin blockchain transactions as C2 backup mechanism appeared first on Security Affairs.

If you like the site, please consider joining the telegram channel or supporting us on Patreon using the button below.

Discord

Original Source