A malicious campaign called EleKtra-Leak has emerged, focused on exploiting exposed AWS Identity and Access Management (IAM) credentials within public GitHub repositories for cryptojacking activities.
Running since at least December 2020, this operation targets up to 474 unique Amazon EC2 instances to mine Monero between August 30 and October 6, 2023. What’s particularly notable is the speed at which the attacks target AWS IAM credentials, often within just four minutes of their exposure on GitHub, suggesting automated scanning and cloning by threat actors. The attacker has also taken steps to blocklist AWS accounts sharing IAM credentials to evade detection.
Evidence indicates that the attacker may be linked to a previous cryptojacking campaign targeting poorly secured Docker services, using the same bespoke mining software, as disclosed by Intezer in January 2021. This campaign leverages vulnerabilities in GitHub’s secret scanning feature and AWS’s AWSCompromisedKeyQuarantine policy to detect and prevent misuse of compromised IAM credentials for launching EC2 instances.
Although the quarantine policy activates within two minutes of credentials becoming public on GitHub, the method through which the keys are exposed remains unclear. The threat actors’ ability to detect and exploit exposed AWS keys not automatically detected by AWS is also concerning.
In the attack chains identified by cybersecurity firm Unit 42, stolen AWS credentials are used to conduct account reconnaissance, create AWS security groups, and launch multiple EC2 instances across various regions from behind a VPN. The cryptojacking operations take place on high-powered AWS instances, enabling the theft of cryptocurrency at a faster rate. The mining software is retrieved from a Google Drive URL, illustrating a trend where malicious actors use widely trusted applications to avoid detection.
To counter such attacks, organizations inadvertently exposing AWS IAM credentials should revoke API connections, remove the keys from GitHub repositories, and carefully audit repository cloning events to detect suspicious activity. Despite effective AWS quarantine policies, the campaign continues to compromise victim accounts at varying frequencies.