AWS
Amazon Web Service
The ARN (Amazon Resource Name) is a unique global identifier for every AWS resource.
THe IAM (Identity and Access Management) is the service that manages users and their permissions within the AWS cloud environment.
Route 53
Managed DNS service. Allows you to register domains, resolve DNS names, and route traffic (latency-based, geolocation-based, failover, etc.) to AWS resources or on-prem environments.
EC2
Compute service based on virtual machine instances. The cloud equivalent of traditional servers—choose instance type, CPU, memory, storage, networking, and OS, then deploy applications.
S3
Object storage. Suitable for files, documents, images, backups, archives, and datasets. Highly scalable and durable; widely used as a data lake or backend storage for applications and content distribution.
RDS
Managed relational database service. Supports engines like MySQL, PostgreSQL, SQL Server, Oracle, and Aurora; handles provisioning, patching, backups, scaling, and high availability (Multi-AZ, read replicas)
Configuration
We can interact with AWS with awscli (DOC).
sudo apt install awscliLet's start awscli and configure it with a profile IAM, a user of your own AWS account.
aws configure --profile <NAME>
# Access Key & Secret Key
# ~/.aws/credentials
# ~/.aws/configEnumeration Credentials
aws --profile <NAME> sts get-caller-identityQuery JMESPath
We should always try to reduce the number of requests we send by saving all output to a local file and then using an external tool like jp to filter that output with JMESPath expressions.
Policy
List inline policies and managed policies.
Group
Role
View a policy
If the compromised credentials don't have the privileges to query for IAM-related information, we need to adopt a brute-force approach using pacu (iam__bruteforce_permissions).
Backdoor account
Create user
Attach the AWS managed AdministratorAccess policy (or other)
Create the access key and secret key for the user
Automated Enumeration
With pacu.
S3
Cloud-based object storage service. Allows objects to be stored in containers called buckets.
Enumeration
Search for resources (ex. in website requests):
To find the S3 bucket region, we can check the HTTP response (X-Amz-Bucket-Region) or with /?location on the bucket.
We can use cloudbrute or cloud-enum
Note:
S3 buckets are commonly misconfigured so that the bucket ACL blocks public access, but allows access to any AWS authenticated user, even if they're in a different AWS account
If we have a private bucket without permission to listing its contents ("Access Denied"), it is still possible that the files inside it are accessible. We can therefore try a brute force attack on the files.
Interaction
It is possible to use arbitrary values for all fields in IAM Configuration because sometimes the target server is configured not to check authentication.
We list all S3 buckets hosted by the server.
We list the common objects and prefixes in the specified bucket.
We can download objects from the buckets.
We can upload object into the buckets.
Account IDs from S3 Buckets
in your AWS account create ROLE with Custom Trust Policy
Now we can run s3-account-search
Users & Role from Account IDs
Similar to the "Account IDs from S3 Buckets" approach.
Add the “AdministratorAccess” managed policy to your IAM user and use pacu.
EC2
AMI
Publicly shared Amazon Machine Images (AMIs) AMIs are virtual machine images containing a pre-installed operating system along with software and files.
EBS
Publicly shared Elastic Block Storage (EBS) snapshots
Last updated
