AWS Enumeration
The Hatiyar AWS enumeration suite provides deep visibility into your AWS infrastructure across multiple services. Each module focuses on specific AWS services, providing detailed resource discovery, configuration analysis, and security assessments.
Available Modules
Section titled “Available Modules”| Module | Description |
|---|---|
| AWS Comprehensive Enumeration | Complete AWS security audit across all services |
| EC2 | Compute instances, security groups, volumes, and AMIs |
| S3 | Storage buckets, encryption, policies, and ACLs |
| IAM | Users, roles, groups, policies, and MFA status |
| Lambda | Serverless functions, layers, and event sources |
| Secrets Manager & Parameter Store | Secrets and parameters with rotation analysis |
| Database | RDS, Aurora, DynamoDB, and ElastiCache |
| Container Services | ECS, EKS, and ECR with image scanning |
| Route53 | DNS zones, records, health checks, and DNSSEC |
| Amplify | Applications, branches, domains, and CI/CD |
Getting Started
Section titled “Getting Started”# Start hatiyar shellhatiyar shell
# List available AWS moduleshatiyar> ls cloud.aws
# Use a specific modulehatiyar> use cloud.aws.ec2EC2 Enumeration Module
Section titled “EC2 Enumeration Module”Comprehensive EC2, VPC, and networking resource discovery for security assessments and infrastructure auditing.
General AWS Setup
Section titled “General AWS Setup”This setup applies to all AWS enumeration modules (EC2, S3, RDS, IAM, etc.)
1. Install AWS SDK
Section titled “1. Install AWS SDK”pip install boto32. Configure AWS Credentials
Section titled “2. Configure AWS Credentials”Choose one of these authentication methods:
Option A: AWS CLI Configuration (Recommended)
Section titled “Option A: AWS CLI Configuration (Recommended)”aws configureProvide:
- AWS Access Key ID
- AWS Secret Access Key
- Default region (e.g.,
us-east-1) - Output format (optional)
Option B: AWS Profile
Section titled “Option B: AWS Profile”aws configure --profile myprofileThen use in hatiyar:
set AWS_PROFILE myprofileOption C: Environment Variables
Section titled “Option C: Environment Variables”export AWS_ACCESS_KEY_ID="your-access-key"export AWS_SECRET_ACCESS_KEY="your-secret-key"export AWS_DEFAULT_REGION="us-east-1"Option D: Direct Credentials (Not Recommended for Production)
Section titled “Option D: Direct Credentials (Not Recommended for Production)”Set credentials directly in hatiyar:
set ACCESS_KEY your-access-keyset SECRET_KEY your-secret-key3. Testing with LocalStack (Local AWS Emulation)
Section titled “3. Testing with LocalStack (Local AWS Emulation)”For development and testing purposes, you can use LocalStack to emulate AWS services locally without using real AWS credentials or resources.
Setup LocalStack
Section titled “Setup LocalStack”Prerequisites:
- Docker installed and running
Start LocalStack:
docker run -d \ --name localstack \ -p 4566:4566 \ localstack/localstack:latestOr using Docker Compose (docker-compose.yml):
version: '3.8'services: localstack: image: localstack/localstack:latest ports: - "4566:4566"Start with:
docker-compose up -dVerify LocalStack is Running:
# Check if container is runningdocker ps
# Check health endpointcurl http://localhost:4566/_localstack/healthExpected output should show the container is running and health check returns a success response.
Configure Fake AWS Credentials with Profile
Section titled “Configure Fake AWS Credentials with Profile”Create a local AWS profile for LocalStack:
# Create a new AWS profile named 'local'aws configure --profile localProvide the following when prompted:
AWS Access Key ID [None]: fakeAWS Secret Access Key [None]: fakeDefault region name [None]: us-east-1Default output format [None]: jsonThen configure the LocalStack endpoint URL for this profile:
aws configure set ENDPOINT_URL http://localhost:4566 --profile localVerify the configuration (should be saved in ~/.aws/config and ~/.aws/credentials):
# View the profile configurationcat ~/.aws/configcat ~/.aws/credentialsUse the Profile in hatiyar
Section titled “Use the Profile in hatiyar”In the hatiyar shell, simply set the profile:
hatiyar> set AWS_PROFILE localThis will automatically use the LocalStack endpoint URL and credentials you configured above.
Test EC2 Enumeration with LocalStack
Section titled “Test EC2 Enumeration with LocalStack”Once you create some emulated aws resources in LocalStack, you can perform enumeration.
# Load EC2 modulehatiyar> use cloud.aws.ec2
# Set the local profilehatiyar> set AWS_PROFILE local
# View configuration to verifyhatiyar> show options
# Run enumerationhatiyar> runThe enumeration will use the endpoint URL (http://localhost:4566) and credentials from your local AWS profile automatically.
Cleanup LocalStack
Section titled “Cleanup LocalStack”# Stop and remove LocalStack containerdocker stop localstackdocker rm localstack
# Or with Docker Compose:docker-compose downEC2 - Quick Start
Section titled “EC2 - Quick Start”Interactive Shell Method
Section titled “Interactive Shell Method”# Start hatiyar shellhatiyar shell
# List cloud moduleshatiyar> ls cloud
# Navigate to AWS namespacehatiyar> use cloud.aws
# Load EC2 modulehatiyar> use cloud.aws.ec2
# View module optionshatiyar> show options
# Set AWS regionhatiyar> set AWS_REGION us-east-1
hatiyar>set AWS_PROFILE <name-of-aws-profie> or set SECRET_KEY and ACCESS_KEY
# Run enumerationhatiyar> runEC2 Module Options
Section titled “EC2 Module Options”View all available options:
hatiyar> use cloud.aws.ec2hatiyar> show optionsConfiguration Options
Section titled “Configuration Options”| Option | Default | Required | Description |
|---|---|---|---|
AWS_REGION | us-east-1 | Yes | AWS region to enumerate |
AWS_PROFILE | (empty) | No | AWS CLI profile name |
ACCESS_KEY | (empty) | No | AWS Access Key ID |
SECRET_KEY | (empty) | No | AWS Secret Access Key |
SESSION_TOKEN | (empty) | No | AWS Session Token (for temporary credentials) |
ENUMERATE_INSTANCES | True | No | Enable instance-centric enumeration |
OUTPUT_FILE | ec2_enumeration_results.json | No | Output JSON file path |
Setting Options
Section titled “Setting Options”# Set AWS regionset AWS_REGION us-west-2
# Use AWS profileset AWS_PROFILE production
# Custom output fileset OUTPUT_FILE my_ec2_audit_2024.jsonCommon AWS Troubleshooting
Section titled “Common AWS Troubleshooting”These troubleshooting tips apply to all AWS enumeration modules.
Connection Issues
Section titled “Connection Issues”Problem: No AWS credentials found
Solution:
- Configure AWS CLI:
aws configure - Or set credentials in module:
Terminal window set ACCESS_KEY your-keyset SECRET_KEY your-secret
Problem: UnauthorizedOperation: You are not authorized to perform this operation
Solution: Add required IAM permissions (see Prerequisites section)
Problem: Could not connect to the endpoint URL
Solution: Check your region setting:
set AWS_REGION us-east-1 # Use correct regionPermission Issues
Section titled “Permission Issues”Problem: Some resources not appearing in results
Solution: Ensure your IAM role/user has all required permissions:
# Test specific permissionaws ec2 describe-instances --region us-east-1aws ec2 describe-security-groups --region us-east-1aws ssm describe-instance-information --region us-east-1Output Issues
Section titled “Output Issues”Problem: JSON file not created
Solution: Check file path and permissions:
# Use absolute pathset OUTPUT_FILE /tmp/ec2_audit.json
# Or ensure current directory is writablels -laProblem: Output file is empty or incomplete
Solution:
- Check console for errors during enumeration
- Enable verbose mode:
set VERBOSE True - Verify AWS credentials have read permissions
Contributing New AWS Modules
Section titled “Contributing New AWS Modules”Want to add support for additional AWS services? See our Contributing Guide
Security Disclaimer
Section titled “Security Disclaimer”⚠️ Authorization Required
These AWS enumeration tools should only be used on AWS accounts you own or have explicit permission to audit. Always:
- Obtain written authorization before enumerating third-party AWS accounts
- Follow your organization’s security policies and procedures
- Comply with AWS Acceptable Use Policy and Terms of Service
- Use read-only IAM credentials when possible (principle of least privilege)
- Protect enumeration results as they contain sensitive infrastructure information
- Store credentials securely and never commit them to version control
- Rotate access keys regularly and follow AWS security best practices
The developers assume no liability for misuse of these tools. Use responsibly and ethically.