Cybersecurity researchers from Trend Micro have uncovered a malicious campaign in which attackers are targeting Docker remote API servers to deploy the SRBMiner crypto miner on compromised instances.
"In this attack, the threat actor used the gRPC protocol over h2c to evade security solutions and execute their crypto mining operations on the Docker host," noted researchers Abdelrahman Esmail and Sunil Bharti in a technical report.
The attack begins with the threat actor conducting a discovery process to identify public-facing Docker API hosts and to determine the availability of HTTP/2 protocol upgrades. They follow this with a connection upgrade request to h2c (an unencrypted version of HTTP/2 without TLS encryption).
Once a connection is established, the adversary uses gRPC methods to manipulate Docker functionalities. These methods allow the attacker to perform tasks related to health checks, file synchronization, authentication, secrets management, and SSH forwarding—all crucial functions within Docker environments.
The attack culminates in a "/moby.buildkit.v1.Control/Solve" gRPC request sent to the Docker server, creating a container used to mine XRP cryptocurrency via the SRBMiner payload, which is hosted on GitHub.
Crypto Mining Exploits
"The malicious actor in this case leveraged the gRPC protocol over h2c, effectively bypassing several security layers to deploy the SRBMiner crypto miner on the Docker host and mine XRP cryptocurrency illicitly," the researchers said.
Trend Micro also highlighted a related campaign in which attackers exploited exposed Docker remote API servers to deploy the perfctl malware. This attack involves probing for open Docker servers, creating a Docker container using the image "ubuntu
", and executing a Base64-encoded payload.
The payload, a shell script, checks for duplicate instances of itself before creating another bash script containing yet another encoded payload. This ultimately downloads a malicious binary disguised as a PHP file ("avatar.php"), which delivers a payload named httpd. This technique mirrors a report from Aqua earlier this month.
Protection Against Docker API Exploits
To safeguard against these types of attacks, it is crucial to secure Docker remote API servers by:
- Implementing strong access controls and authentication mechanisms.
- Monitoring Docker hosts for any suspicious or unauthorized activities.
- Following container security best practices to mitigate potential exploits.