Attackers are searching for containers that expose a misconfigured port for the Docker API to add another container to do their bidding and run malicious code to mine cryptocurrency, container security firm Aqua Security stated in an April 3 advisory.
The campaign appears to target containers that allow Docker commands to be executed without authentication, with — in some cases — more than a hundred scans targeting each IP address on the Internet every day. A search using the port-scanning service Shodan revealed that some 6,000 IP addresses may have vulnerable installations of Docker, says Idan Revivo, head of cybersecurity research for Aqua Security.
"We can't say from those 6,000 images how many are infected for sure, but we can see from the volumes that this is a very aggressive attack," he says. "Someone is putting a lot of effort into scanning the Internet on a daily, and perhaps hourly, basis."
Docker instances that have an unprotected port are used to instantiate a container running Ubuntu Linux, install a download utility, and then execute a 600-line program written in the Go programming language. The script attempts to turn off security, stop any competing cryptominers, and download the malicious cryptominer known as "Kinsing."
The Kinsing malware is the latest attack on unsecured and misconfigured Docker containers. In October, another attack, dubbed Graboid, used a similar attack to download malicious images from the Docker Hub. The images would run a cryptominer to attempt to generate Monero cryptocurrency for the attacker.
The Kinsing attack is arguably a more sophisticated attempt to turn clusters of containers in cryptomining server farms. One of the scripts downloaded by the Kinsing malware includes the ability to search for potentially vulnerable containers on the same Docker network. The program looks at the past history of commands, a list of other trusted computers, and in other files to identity targets in the current container's network.
"Using the information gathered, the malware then attempts to connect to each host, using every possible user and key combination through SSH, in order to download the aforementioned shell script and run the malware on other hosts or containers in the network," Gal Singer, a security researcher with Aqua Security, said in the company's analysis.
While the attacks are not attempting to delete data or damage the systems of the victims, they do consume a great deal of computing power, running up the bill for the owner of the container cluster.
Unlike Graboid, which downloaded a custom-made malicious image, Kinsing downloads a Ubuntu Linux image to sidestep basic blacklists that might otherwise block a malicious image from being instantiated as a container.
"Some companies are doing blacklisting and whitelisting of images, and Ubuntu and Alpine [Linux] are the two most common images," Revivo says. "So by using an image that is whitelisted to fetch the payload, they are working around the security."
Three different IP addresses are currently used as part of the attack.
Aqua Security recommends that cloud administrators and DevSecOps teams identify and review their cloud resources, using automated testing to prevent misconfigurations, and investigate logs for anomalies. As part of its analysis, the company mapped the different components of the attack on the MITRE ATT&CK framework, a catalog of techniques used by attackers during their operations.
"This attack stands out as yet another example of the growing threat to cloud native environments," Singer stated in the advisory. "With deployments becoming larger and container use on the rise, attackers are upping their game and mounting more ambitious attacks, with an increasing level of sophistication."