Aws S3 Bucket

An AWS S3 bucket is a cloud-based storage container that holds files, known as objects, which can be accessed over the internet. It is highly scalable and can store large amounts of data, such as documents, images, and backups. S3 provides robust security through access control, encryption, and permissions management. It ensures high durability and availability, making it ideal for storing and retrieving data from anywhere.

Tools

sudo apt install awscli
wget https://digi.ninja/files/bucket_finder_1.1.tar.bz2 -O bucket_finder_1.1.tar.bz2
./bucket_finder.rb my_words
./bucket_finder.rb --region ie my_words
./bucket_finder.rb --download --region ie my_words
./bucket_finder.rb --log-file bucket.out my_words
import boto3
s3 = boto3.client('s3',aws_access_key_id='AKIAJQDP3RKREDACTED',aws_secret_access_key='igH8yFmmpMbnkcUaCqXJIRIozKVaREDACTED',region_name='us-west-1')

try:
 result = s3.list_buckets()
 print(result)
except Exception as e:
 print(e)

Credentials and Profiles

Create a profile with your AWSAccessKeyId and AWSSecretKey, then you can use --profile nameofprofile in the aws command.

Alternatively you can use environment variables instead of creating a profile.

Public S3 Bucket

An open S3 bucket refers to an Amazon Simple Storage Service (Amazon S3) bucket that has been configured to allow public access, either intentionally or by mistake. This means that anyone on the internet could potentially access, read, or even modify the data stored in the bucket, depending on the permissions set.

  • http://s3.amazonaws.com/<bucket-name>

  • http://<bucket-name>.s3.amazonaws.com

  • https://<bucket-name>.region.amazonaws.com/<file>

AWS S3 buckets name examples: http://flaws.cloud.s3.amazonaws.comarrow-up-right.

Either bruteforce the buckets name with keyword related to your target or search through the leaked one using OSINT tool such as buckets.grayhatwarfare.comarrow-up-right.

When file listing is enabled, the name is also displayed inside the <Name> XML tag.

Bucket Interations

Find the Region

To find the region of an Amazon Web Services (AWS) service (such as an S3 bucket) using dig or nslookup, query the DNS records for the service's domain or endpoint.

List Files

To list files in an AWS S3 bucket using the AWS CLI, you can use the following command:

Copy, Upload and Download Files

  • Copy

  • Upload

  • Download

List File Versions

When versioning is enabled in an AWS S3 bucket, list file history using the AWS CLI:

Download a Specific File Version

References

Last updated