3.2 AWS Black Box Methodology
3.2 AWS Black Box Methodology
Methodology
HackTricks Training
Cyber Kill Chain
1- Enumeration
2- Exploitation
3- Internal Enumeration
4- Post exploitation
5- Persistence
6- Privilege Escalation
7- Profit
Discovery & Enumeration
● OSINT
○ Github Leaks
● Open Buckets
○ Spidering
○ Brute-Force
● Open ports
○ Exploits
○ Brute-Force credentials
● Web
○ SSRF
● Public AMIs, EBS Snapshots, RDS Snapshots
● Roles & Usernames enumeration
● Cognito Credentials
● Federated Identities
Attack: We found some Cognito misconfiguration
DEMO
Exploitation
● OSINT
○ Github Leaks
○ https://book.hacktricks.xyz/generic-methodologies-and-resources/external-recon-methodolog
y/github-leaked-secrets
● Open Buckets
○ Spidering
○ Brute-Force
○ https://cloud.hacktricks.xyz/pentesting-cloud/aws-pentesting/aws-unauthenticated-enum-acc
ess/aws-s3-unauthenticated-enum
● Open ports
○ Exploits
○ Brute-Force credentials
● Web
○ SSRF
○ https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf
● Public AMIs, EBS Snapshots, RDS Snapshots
○ https://cloud.hacktricks.xyz/pentesting-cloud/aws-pentesting/aws-unauthenticated-enum-acc
ess/aws-ec2-unauthenticated-enum
● Roles & Usernames enumeration (demo)
Attack: We got Cognito credentials
● Cognito Credentials (demo)
DEMO
Internal Enumeration
● Web Console
● AWS cli
● Steampipe
○ https://github.com/turbot/steampipe-mod-aws-perimeter
○ https://github.com/turbot/steampipe-mod-aws-insights
● CloudSploit
● Cloudfox
● Prowler doesn’t work without access to generate a credential report
● Current privileges BF:
○ https://github.com/carlospolop/bf-aws-permissions
○ https://github.com/carlospolop/bf-aws-perms-simulate
○ https://github.com/carlospolop/aws-Perms2ManagedPolicies
○ https://github.com/carlospolop/tfstate2IAM
○ https://github.com/carlospolop/Cloudtrail2IAM
○ https://github.com/carnal0wnage/weirdAAL
○ https://github.com/andresriancho/enumerate-iam