Massive PII Data Leak Resulting from SSRF Attack on EC2 Instance Using IMDSv1
Vignesh Kannan
Emerging Products Solutions Engineering Leader @SentinelOne - APJ | Growth Hacker | Global Speaker | Evangelist | Global Role at SentinelOne | Ex PingSafe | Ex Zoho | Ex Paladion | Ex ATOS |
Introduction:
A multi-phased attack which involved infrastructure scanning, reconnaissance & further abuse of the underlying abstraction layers offered by cloud-hosted platforms.
I have tried to map it with MITRE ATT&CK Framework to capture the different stages of the attack.
Reconnaissance:
The attacker targeted the attack with reconnaissance to see the publicly exposed assets of the victim to identify if there are any vulnerabilities?or misconfigurations to take advantage of.
The attacker noticed that the victim had an AWS infrastructure hosting Adminer. .
Now the attacker shifted the gear to perform deep level reconnaissance which helped them to exploit the web server.
Exploitation & C&C phase:
1. The attacker hosted a pre-configured web server on a relay box with a 301 redirect script back to the?https://169.254.169.254/latest/meta-data/iam/security-credentials/
2. Through the adminer interface, the attacker entered the address of the relay box hosting the redirect script and then pressed the login button.
3. This maneuver deceived the targeted server into succumbing to a 301 redirect attack. Let us understand what a 301 redirect is.
Credentials Theft:
Because of the above, the victim's server returned an error which included the redirect output, which contained the AWS API credentials belonging to the victim (IMDSv1 vulnerability). AWS Instance Metadata Service (IMDS) provides the complete metadata of your instance. It presents all the necessary information required for configuring and managing the instance. The retried metadata included information to understand configuration, topology, and even obtain user role and credentialing.
领英推荐
From the response of the IMDS, the attacker got hold of AWS API credentials. Since least privilege was not followed and the access key has the admin privileges.
Lateral Movement:
Once the keys are there with the hands of the attacker, the attacker tried laterally move within the cloud estate and found some sensitive S3 buckets holding millions of PII data.
Exfiltration:
Using the AWS API credentials, the attacker targeted a S3 bucket which had millions of PII data which was exfiltrated and this turned out to be one of the worst nightmares of the cloud security breaches.
Lessons learned:?
Conclusion:
So, here's the scoop: I've got this knack for tuning into what's going on in your noggin. And guess what? It's not all that hard to spot! But wait, there's more – we can totally automate the whole detection shindig.
If you're curious to dive deeper into this mind-bending territory, just give me a shout. I'm all ears and ready to spill the beans on some seriously slick methods to handle these mind-reading scenarios like a champ. Hit me up anytime!
I hope you find this article useful and informative. If you're vibing with what you read, a comment or a thumbs-up would seriously make my day. Let's team up and make sure folks all around the world are in the know, so they can shield their cloud gear from those pesky attacks. Your two cents could be a game-changer!
--
Best Regards,
Vignesh Kannan
Cyber Security Evangelist
Leading Digital Transformation. Organization Change Management
1 年Good article vignesh.
Threat Hunting | AI & ML Cyber Security Investigator | OSINT Adversary Hunting
1 年Thank you Vignesh Kannan