Skip to content

Instantly share code, notes, and snippets.

@refabr1k
Last active July 21, 2023 17:31
Show Gist options
  • Save refabr1k/18a42981c4e9792f8cf9697748415f59 to your computer and use it in GitHub Desktop.
Save refabr1k/18a42981c4e9792f8cf9697748415f59 to your computer and use it in GitHub Desktop.
AWS Pentesting Playbook

AWS Cloud Pentesting playbook

Learn

IAM

https://aws.amazon.com/architecture/security-identity-compliance/
https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html
https://aws.amazon.com/architecture/security-identity-compliance/
https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html

Hacking AWS end-to-end - remastered (https://www.youtube.com/watch?v=8ZXRw4Ry3mQ)

Slides and code: https://github.com/dagrz/aws_pwn

Attacking AWS: the full cyber kill chain | SANS Cloud & DevOps Security Summit 2020 (https://www.youtube.com/watch?v=njsNy2bNuT8)

Scoping for Cloud PT engagements

Understanding The Shared Responsibility Model AWS uses a Shared Responsibility Model, which contains two parts: \

Security of the Cloud which falls under AWS's responsibility
Security in the Cloud which is the customer’s responsibility. 

The scope and boundaries are defined in the scoping process of a cloud penetration test assessment in which at least the following questions are asked:

How many non-standard AWS Identity and Access Management (IAM) policies exist?
Which services are used? 
How many IAM Policies are assigned?
How many accounts exist?

In a cloud penetration test we first need to determine (even though this was also included during the scoping process) which services are:

Used by the application (e.g., EC2 vs Lambda)
Externally exposed (e.g., S3 bucket with static CSS files vs DynamoDB)
Managed by AWS or by the customer

This also involves enumerating and fingerprinting the cloud infrastructure for used components and further third-party software.

Depending on the information given before the penetration test or information identified throughout the assessment, this may also involve stepping into AWS Identity and Access Management (IAM). AWS Identity and Access Management service is used to control access to AWS resources by defining policies.

Typical requirements to conduct Cloud PT

Privilege Escalation

Pivoting

todo

Tooling

pacu - https://github.com/RhinoSecurityLabs/pacu
prowler - https://github.com/prowler-cloud/prowler
scoutsuite - https://github.com/nccgroup/ScoutSuite
steampipe - https://github.com/turbot/steampipe
aws stealh scan - https://github.com/cyberark/SkyArk
iam action hunter - https://github.com/RhinoSecurityLabs/IAMActionHunter
s3 buckets auditing - https://github.com/toniblyx/my-arsenal-of-aws-security-tools#s3-buckets-auditing
s3scanner -  https://github.com/sa7mon/S3Scanner
bucketstream - https://github.com/eth0izzle/bucket-stream
redteam scripts - https://github.com/ihamburglar/Redboto
cloudfox - https://github.com/BishopFox/cloudfox
whispers (find secrets) - https://github.com/Skyscanner/whispers
trufflehog (s3 tool) - https://github.com/trufflesecurity/trufflehog
dufflebag (ebs tester) - https://github.com/bishopfox/dufflebag

Practice ground

https://github.com/RhinoSecurityLabs/cloudgoat
https://github.com/BishopFox/iam-vulnerable
https://github.com/ine-labs/AWSGoat
http://flaws.cloud/
http://flaws2.cloud/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment