Skip to content

Commit

Permalink
Merge pull request #115 from Hacking-the-Cloud/update_ec2_credential_…
Browse files Browse the repository at this point in the history
…exfiltration

Added note about a niche credential exfiltration GuardDuty bypass
  • Loading branch information
Frichetten authored Jan 23, 2022
2 parents f63d03c + 905e784 commit 924e4a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion content/aws/avoiding-detection/steal-keys-undetected.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ On January 20th 2022, AWS released a new GuardDuty finding called [UnauthorizedA

However, there is currently a functioning bypass for this - [VPC Endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints.html). Using VPC Endpoints will not trigger the GuardDuty alert. What this means is that, as an attacker, `if you steal IAM credentials from an EC2 instance, you can use those credentials from your own EC2 instance while routing traffic through VPC Endpoints. This will not trigger the GuardDuty finding`.

To make this setup faster (and easier) for Penetration Testers and Red Teamers, [SneakyEndpoints](https://github.com/Frichetten/SneakyEndpoints) was created. This project has all the Terraform configurations necessary to spin up an environment to attack from. It will create an EC2 instance in a private subnet (no internet access) and create a number of VPC Endpoints for you to use. This setup ensures we don't accidentally expose ourselves and trigger the alert.
To make this setup faster (and easier) for Penetration Testers and Red Teamers, [SneakyEndpoints](https://github.com/Frichetten/SneakyEndpoints) was created. This project has all the Terraform configurations necessary to spin up an environment to attack from. It will create an EC2 instance in a private subnet (no internet access) and create a number of VPC Endpoints for you to use. This setup ensures we don't accidentally expose ourselves and trigger the alert.

!!! Note
There is another bypass option, however, it would only be useful in niche scenarios. The InstanceCredentialExfiltration finding is only tied to the AWS account, not the EC2 instance. As a result, if you compromise an EC2 instance in the target account and then compromise OTHER EC2 instances in the account, or steal their IAM credentials, you can safely use them from the initially compromised instance without fear of triggering GuardDuty.

0 comments on commit 924e4a1

Please sign in to comment.