❌

Normal view

There are new articles available, click to refresh the page.
Today β€” 19 June 2024Security News

Cryptojacking campaign targets exposed Docker APIs

19 June 2024 at 07:31

A malware campaign targets publicly exposed Docker API endpoints to deliver cryptocurrency miners and other payloads.

Researchers at Datadog uncovered a new cryptojacking campaign linked to the attackers behindΒ Spinning YARN campaign.

The threat actors target publicly exposed and unsecured Docker API endpoints for initial access.

The attack begins with the threat actor scanning the internet to find hosts with Docker’s default port 2375 open. After locating a valid host, they perform Docker reconnaissance by querying the Docker host’s version using the docker version command. Following this confirmation, the attacker starts the exploitation phase by attempting to create an Alpine Linux container and using Docker’s Binds parameter to map the host’s root directory (/) to a directory within the container (/mnt). Below is the command snippet used in the campaign:

"Image": "alpine",
"HostConfig": {
  "Binds": ["/:/mnt"]
}

If this step is successful, the attacker gains access to the Docker host’s underlying filesystem through the /mnt directory inside the container, allowing them to escalate their privileges.

In addition to defining the container image and host configuration parameters, the attacker executes a shell command within the container itself to set the root of subsequent processes.

The attackers were observed deploying multiple payloads, including a remote access tool (chkstart) that downloads and executes additional malicious payloads and a tool to perform lateral movement (exeremo) used to propagate the malware via SSH.

The threat actors used a a shell script named β€œvurl” to retrieve the malicious payloads from a server under their control. The script includes another shell script called β€œb.sh” that, in turn, packs a Base64-encoded binary named β€œvurl” and is also responsible for fetching and launching a third shell script known as β€œar.sh” (or β€œai.sh”).

β€œAfter the attacker gains initial access and achieves execution via cron, the next stage of the campaign is to fetch and execute a new shell scriptβ€”b.sh. This script contains a base64-encoded tar archive of a new binary namedΒ vurl. The script decodes and extracts this binary toΒ /usr/bin/vurl, overwriting the existing shell script version, before fetching and executing one of two shell scriptsβ€”ar.shΒ orΒ ai.sh.” reads the report published by the researchers.

The attackers use an unusualΒ persistence mechanismΒ by modifying existing systemd services and using theΒ ExecStartPostΒ configuration option to execute malicious commands.

The shell script β€œar.sh” is used for multiple purposes including setting up a working directory, installing tools to scan the internet for vulnerable hosts, remove existing cron entries, weaken the system by disabling firewalls, clearing shell history, and preventing new lines from being added to the history file.

The script is ultimately used to fetch the next-stage payload β€œchkstart.”

Attackers used Golang binary, such as vurl, to set up a remote access and download additional tools from a remote server. The experts observed attackers downloading β€œm.tar,” and an XMRig miner called β€œtop,”.

Docker malware

β€œThis update to the Spinning YARN campaign shows a willingness to continue attacking misconfigured Docker hosts for initial access. The threat actor behind this campaign continues to iterate on deployed payloads by porting functionality to Go, which could indicate an attempt to hinder the analysis process, or point to experimentation with multi-architecture builds.” concludes the report.

β€œAlthough the likely objective of this campaign is to deploy an XMRig miner to compromised hosts, the attackers also ensured that they maintain access to victim machines via SSH. Maintaining remote code execution to victim hosts could mean that attackers can leverage their access for additional objectives”

Follow me on Twitter:Β @securityaffairsΒ andΒ FacebookΒ andΒ Mastodon

PierluigiΒ Paganini

(SecurityAffairs – hacking, Docker)

❌
❌