Bucket inspector that can help users extract assets, flag secret exposures and even search for custom keywords as well as Regular Expressions from publicly-exposed storage buckets by scanning files that store data in plain-text.
By default, the AWS CLI includes prefix= (an empty prefix) and delimiter=/ in requests
Check for https://target.com.s3.amazonaws.com/?prefix=&delimiter=/
List bucket content - Anon
If you found an URL like http://target.s3.eu-west-2.amazonaws.com remove the s3.region.amazonaws.com part
By default AWS cli tool interacts with s3.amazonaws.com . If you have another domain hosting
it, you can use --endpoint-url option to point the tool to another domain.
List buckets - with profile
Download one file
Download all files
download all of the bucket’s contents:
List the bucket ACL
List & get objects
Bucket policy
Bucket Policies are attached directly to the bucket and define what actions are allowed or denied by which principal.
More readable
Enumerate Lambda
One misconfiguration organizations often make with Lambda is including sensitive information in the environmental variables of the function
An attacker with the iam:CreateAccessKey permission on other users can create an access key ID and secret access key belonging to another user in the AWS environment
An attacker with the iam:CreateLoginProfile permission on other users can create a password to use to login to the AWS console on any user that does not already have a login profile setup.
arn:aws:iam::[Account_ID]:user/[Username]
You can now login as the victim into the AWS console
Make sure to use a filename with a non-trivial name to prevent any disruption
Upload a shell
Read Permissions on ACL
Write Permissions on ACL
You do not have to always necessarily change an ACL to test for write permissions if read permissions are enabled. You can simply check the "Grants" property in the response to a read operation and verify if any unauthorized users are allowed to perform the write operation!
Get the database instance connection temporary token from the RDS endpoint
Connect to mysql using temporary token
Snapshots
Public snapshots from single RDS database instances that belong to AWS account ID
Public snapshots from RDS database cluster instances
The snapshot can be restored. From the Actions menuin GUI, select Restore snapshot
EBS - Elastic Block Store
A block storage system used to store persistent data. used for EC2 instances.
Enumeration
Information about EBS volumes
All available EBS snapshots
Create volume permissions
The value of Group is set to all. This reveals that it is a publicly accessible snapshot and any AWS user will be able to create a volume from this public snapshot into their AWS Account.
Disclaimer: As an Amazon Associate, I earn from qualifying purchases. This helps support this GitBook project at no extra cost to you.
Advanced Penetration Testing: Hacking AWS 2
This book delves deeper into analyzing the security of various AWS services and shows techniques and tactics used by an attacker to breach an AWS environment
# Lists the versions for a specific secret
# To issue this command, you must have secretsmanager:ListSecretVersionIds access
aws secretsmanager list-secret-version-ids --secret-id <value>