Security

Research

Cryptojackers steal AWS credentials from GitHub in 5 minutes

Researchers just scratching surface of their understanding of campaign dating back to 2020


Security researchers have uncovered a multi-year cryptojacking campaign they claim autonomously clones GitHub repositories and steals their exposed AWS credentials.

Given the name "EleKtra-Leak" by researchers at Palo Alto Networks's Unit 42, the criminals behind the campaign are credited with regularly stealing AWS credentials within five minutes of them being exposed in GitHub repositories.

Minutes later, multiple Amazon Elastic Compute Cloud (EC2) instances can be launched in as many regions as possible to mine Monero. In the space of just over a month, between August 30 and October 6, the researchers identified 474 different miners being operated by "potentially actor-controlled EC2 instances."

Initial tests showed that GitHub's secret scanning feature largely worked as intended, notifying AWS of an exposed credential in a repository with the cloud provider then issuing a policy to prevent misuse within minutes.

"We believe the threat actor might be able to find exposed AWS keys that aren't automatically detected by AWS and subsequently control these keys outside of the AWSCompromisedKeyQuarantine policy," said William Gamazo and Nathaniel Quist, senior principal researcher and manager of cloud threat intelligence at Unit 42, respectively.

"According to our evidence, they likely did. In that case, the threat actor could proceed with the attack with no policy interfering with their malicious actions to steal resources from the victims.

"Even when GitHub and AWS are coordinated to implement a certain level of protection when AWS keys are leaked, not all cases are covered. We highly recommend that CI/CD security practices, like scanning repos on commit, should be implemented independently."

AWS's quarantine policy is effective at stopping attacks, and the researchers overwrote it in their own repositories so they could gain greater visibility into the campaign by letting it run as the attacker intended.

Unit 42 confirmed to The Register that the credentials found in the research were sourced via GitHub by the attackers, despite the AWS policy being applied rapidly, but attackers also exhibited evidence of using multiple methods to acquire the AWS logins outside the scope of the researchers' investigation.

Current predictions are that they are either retrieving credentials via GitHub but through other means, or finding them exposed on a different platform.

"Despite successful AWS quarantine policies, the campaign maintains continuous fluctuation in the number and frequency of compromised victim accounts," the researchers said.

"Several speculations as to why the campaign is still active include that this campaign is not solely focused on exposed GitHub credentials or Amazon EC2 instance targeting."

Once the credentials are acquired, the criminals – working behind a VPN – perform a reconnaissance operation to understand more about the account itself, such as the regions it has enabled. They then create security groups and launch EC2 instances across as many regions that are enabled for the account.

"They repeated the same operations across multiple regions, generating a total of more than 400 API calls and taking only seven minutes, according to CloudTrail logging," said the researchers. 

"This indicates that the actor is successfully able to obscure their identity while launching automated attacks against AWS account environments."

Diagram of the attack chain in the EleKtra-Leak campaign

The EC2 instances launched were large-format, mostly of type c5a.24xlarge. It's typical of cryptojacking campaigns to use these as it offers attackers greater processing resources for faster results.

Google Drive hosts the malicious mining payload. Using legitimate services is a tactic increasingly adopted by attackers due to the protections they afford. In Google Drive's case, the platform's URLs are anonymous and can't be linked back to a specific Google Account.

It was just one technique that made attributing the attack difficult for the researchers. Another issue was the attackers' goal of mining Monero, a cryptocurrency with built-in privacy protections, again limiting their ability to trace the owner of wallets.

The miner payload is stored as an encrypted file and decrypted after it's downloaded, and researchers said it bears a resemblance to an earlier campaign from 2021.

Intezer previously documented a cryptojacking campaign that used malware with the same hash as the latest example, leading researchers to believe they could be at least connected.

For those looking for ways to mitigate the threat of exposing AWS credentials via GitHub, configuring secret scanning is shown to be a highly effective tool to prevent misuse.

For any AWS credentials that are exposed, the API connections made using them should be immediately revoked, the researchers said. ®

Send us news
3 Comments

AWS exec: 'Our understanding of open source has started to change'

Apache Foundation president David Nalley on Amazon Linux 2023, Free software, and more

AWS accuses Microsoft of clipping customers' cloud freedoms

World's biggest off-prem service slinger submits comments to UK cloud inquiry, mostly has Redmond HQ's rival in its sights

The AI everything show continues at AWS: Generate SQL from text, vector search, and more

Invisible watermarks on AI-generated images? Sure. But major tools in the stack matter most

AWS unveils core-packed Graviton4 and beefier Trainium accelerators for AI

Also hedging its bets with a healthy dose of Nvidia chips too

AWS plays with Fire TV Cube, turns it into a thin client for cloudy desktops

$195 a pop, delivered, pre-provisioned ready to stream desktops or apps

Leader of pro-Russia DDoS crew Killnet 'unmasked' by Russian state media

Also: NXP China attack, Australia can't deliver on ransom payment ban (yet), and Justin Sun's very bad month

Now AWS gets a ChatGPT-style Copilot: Amazon Q to be your cloud chat assistant

Anthropic CEO also rocks up on stage for reasons

You're so worried about AWS reliability, the cloud giant now lets you simulate major outages

Fake it 'til you break it, for a whole availability zone or WAN FAIL

Watchdog claims retaliation from military after questioning cushy federal IT contracts

IT-AAC had a hand in scrutinizing JEDI, now faces probe for challenging $300M+ single-source deals

AWS previews AppFabric for productivity – pitched as AI-powered glue between apps

Park user data in Amazon's servers for ML-generated insights and actions – yea or nay for you?

Google submits complaints about Microsoft licensing to UK competition regulator

Now Microsoft has regulator breathing down its neck in three regions

AWS rakes in half a billion pounds from UK Home Office

Someone has to top up the Bezos rocket fund, like British taxpayers