AWS S3 Buckets

AWS Configuration


Prerequisites, at least you need awscli

sudo apt install awscli

You can get your credential here https://console.aws.amazon.com/iam/home?#/security_credentialarrow-up-right but you need an aws account, free tier account : https://aws.amazon.com/s/dm/optimization/server-side-test/free-tier/free_np/arrow-up-right

aws configure
AWSAccessKeyId=[ENTER HERE YOUR KEY]
AWSSecretKey=[ENTER HERE YOUR KEY]
aws configure --profile nameofprofile

then you can use --profile nameofprofile in the aws command.

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

export AWS_ACCESS_KEY_ID=ASIAZ[...]PODP56
export AWS_SECRET_ACCESS_KEY=fPk/Gya[...]4/j5bSuhDQ
export AWS_SESSION_TOKEN=FQoGZXIvYXdzE[...]8aOK4QU=

Open Bucket


By default the name of Amazon Buckets are like http://s3.amazonaws.com/[bucket_name]/arrow-up-right, you can browse open buckets if you know their names.

Their names are also listed if the listing is enabled.

Alternatively you can extract the name of inside-site s3 bucket with %C0. (Trick from https://twitter.com/0xmdv/status/1065581916437585920arrow-up-right)

Basic tests


Listing files

You can get the region with a dig and nslookup

Move a file into the bucket

Download every thing

Check bucket disk size

Use --no-sign for un-authenticated check.

AWS - Extract Backup


Bucket juicy data


Amazon exposes an internal service every EC2 instance can query for instance metadata about the host. If you found an SSRF vulnerability that runs on EC2, try requesting :

For example with a proxy : http://4d0cf09b9b2d761a7d87be99d17507bce8b86f3b.flaws.cloud/proxy/169.254.169.254/latest/meta-data/iam/security-credentials/flaws/arrow-up-right

References


Last updated