AWS Keys to Internal IPs: An Enumeration Walkthrough ☁️
Got AWS Access & Secret Keys? Here's how they can reveal far more than you'd expect ๐
✅ Step 1: Configure and Validate Access
๐ฏ Objective: Confirm credentials are valid
Use the AWS CLI:
aws configure --profile pentest-profile
aws sts get-caller-identity --profile pentest-profile
๐ Output:
{
๐งพ Step 2: Discover IAM Permissions
๐ฏ Objective: See what the identity is allowed to do
aws iam list-attached-user-policies --user-name <<>> --profile pentest-profile
Then for each policy:
aws iam get-policy --policy-arn arn:aws:iam::aws:policy/SomePolicy --profile pentest-profile
Get the version ID and fetch the full policy:
aws iam get-policy-version --policy-arn <ARN> --version-id <ID> --profile pentest-profile
๐ Output (sample permission):
๐ฆ Step 3: Enumerate EC2 Instances
๐ฏ Objective: Use discovered permissions
aws ec2 describe-instances --profile pentest-profile
๐ Output sample:
Now you have:
-
✅ Instance metadata
-
✅ Tags (e.g., Name, Env)
-
✅ Private IPs (internal access)
๐ฃ Step 4: Assess What’s Accessible Internally
๐ฏ Objective: Think beyond enumeration
What can these private IPs lead to?
-
Internal dashboards (e.g., Jenkins, Adminer)
-
Metadata APIs (e.g., http://169.254.169.254)
-
Dev environments with RCE potential
Even without write or execute rights — enumeration alone can become weaponized.
๐ The Takeaway
๐ Access Key ≠ harmless
๐ Private IP = pivot point
๐ Always enumerate before you escalate
Comments
Post a Comment