Skip to content

capture0x/aws-pentest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

172 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

AWS Pentest Tool logo

AWS Pentest Tool

Python 3.8+ MIT License v3.0.0 30 Modules MITRE ATT&CK

Professional AWS cloud security auditing tool โ€” 30 modules covering IAM, S3, compute, networking, serverless, containers, data stores, messaging, DNS, WAF, CI/CD secrets, organizational governance, and event-driven architectures.


Overview

AWS Pentest Tool performs automated security audits across all major AWS services. It detects misconfigurations, privilege escalation paths, publicly exposed resources, secret leakage, and detection gaps โ€” then generates an executive-grade Markdown report with severity ratings, PoC commands, and remediation guidance.

Authorization required. This tool is for authorized penetration testing, red team engagements, and security audits only.

๐Ÿ‘‡ How to use ๐Ÿ‘‡

How to use

Quick Start

# 1. Clone & install
git clone https://github.com/capture0x/aws-pentest.git
cd aws-pentest
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt

# 2. Configure credentials
python3 aws_agent.py configure

# 3. Run a full audit
python3 aws_agent.py audit --mode all

# 4. Targeted module scans
python3 aws_agent.py scan-dns
python3 aws_agent.py scan-apigw
python3 aws_agent.py scan-cognito

Module Coverage (30 Modules)

# Module File Key Checks
00 Master Audit account.py Account ID, caller identity, password policy, aliases
01 IAM Privilege Escalation iam.py CreateAccessKey, PassRole, AssumeRole, wildcard policies
02 S3 Misconfiguration s3.py, s3_website.py Public ACL, Block Public Access bypass, website hijack
03 Multi-Region Compute compute.py EC2 enum, user-data secret scanning, multi-region
04 Network Security Groups network_sg.py 0.0.0.0/0 admin ports, IPv6, NACL, critical service exposure
05 Logging Posture logging.py CloudTrail, GuardDuty, Config, VPC Flow Logs status
06 RDS / KMS / Secrets rds.py, kms_secrets.py Publicly accessible RDS, unencrypted snapshots, secret rotation
07 Lambda Analysis lambda_analysis.py Env vars, Function URL, public invoke, PassRole in execution role
08 EKS Cluster eks_analysis.py Public API endpoint, audit logs, node IAM role scope
09 CloudTrail Exfiltration cloudtrail_exfil.py Public log buckets, cross-account access, unencrypted storage
10 EBS Snapshots ebs_snapshots.py Public/shared snapshot exposure, unencrypted volumes
11 S3 Subdomain Enum s3_subdomain.py Bucket takeover, CNAME dangling verification
12 Git Repo Detector s3_git_detector.py Exposed .git artifacts on S3, SSRF risks
13 ECR Containers ecr_analysis.py Public repos, scan findings, mutable tags
14 IAM Backdoor Generator iam_backdoor.py Dry-run, confirmation guard, credential output
15 IMDS Enumeration imds_enum.py IMDSv1/v2, SSRF, role credential leakage, user-data secrets
16 SSM-Managed EC2 ssm_ec2.py Session Manager scope, Run Command boundaries, RCE paths
17 S3 Versioning History s3_versions.py Deleted secret recovery, regex pattern matching
18 Amazon MQ / ActiveMQ mq_enum.py Broker exposure, default credentials, CVE versions
19 STS Cross-Account sts_cross_account.py Trust policy analysis, confused deputy, OIDC conditions, role chains
20 API Gateway api_gateway.py Auth bypass, resource policy, WAF, JWT authorizers, CORS wildcard
21 Cognito / Identity Pool cognito.py Unauthenticated access, MFA policy, app client secrets
22 DynamoDB dynamodb.py Access control, encryption at rest, stream exposure, PITR
23 SQS / SNS sqs_sns.py Public policy, subscription endpoint leakage, SSE/KMS
24 CloudFormation cloudformation.py Stack output secrets, stack role privesc, drift
25 Route53 / DNS route53.py Subdomain takeover, DNSSEC, NS delegation hijack
26 CodeBuild / CodePipeline codebuild_pipeline.py Plaintext env var secrets, buildspec hardcoded creds, privileged mode, unencrypted artifacts
27 WAF Rule Analysis waf_analysis.py Default-ALLOW posture, missing managed rules, no rate limit, logging disabled, unassociated ACLs
28 SCP Audit scp_audit.py Organization membership, SCP coverage gaps, missing critical denies, unprotected OUs
29 Step Functions / EventBridge stepfunctions_eventbridge.py Public event buses, cross-account targets, API destination HTTP endpoints, state machine logging gaps, hardcoded secrets

Commands

Core

Command Description
configure Save AWS credentials to .env (supports session tokens)
audit Full multi-module audit with Markdown report generation
exploit-iam IAM privilege escalation analysis + PoC CLI commands
exploit-s3 S3 misconfiguration exploitation hints per bucket
backdoor-create [DESTRUCTIVE] Create persistent IAM admin user with dry-run guard

Targeted Module Scans

Command Module Key Output
scan-sts STS Cross-Account Risky trust policies, OIDC providers, role chains
scan-apigw API Gateway Auth bypass, WAF gaps, JWT authorizer issues
scan-cognito Cognito Unauthenticated pools, MFA status, app client issues
scan-dynamodb DynamoDB Encryption, stream exposure, resource policy
scan-sqs-sns SQS / SNS Public policies, HTTP subscriptions, missing SSE
scan-cfn CloudFormation Secret outputs, stack role privesc, drift
scan-dns Route53 Subdomain takeovers, DNSSEC, NS hijack
scan-codebuild CodeBuild / CodePipeline Plaintext secrets, buildspec creds, privileged mode, unencrypted artifacts
scan-waf WAF Rule Analysis Default-ALLOW posture, missing managed rules, logging gaps, unassociated ACLs
scan-scp SCP Audit Organization membership, missing critical denies, unprotected OUs
scan-sfn Step Functions / EventBridge Public event buses, cross-account rules, state machine logging, hardcoded secrets
# STS โ€” Cross-account role trust & OIDC analysis
python3 aws_agent.py scan-sts
python3 aws_agent.py scan-sts --regions us-east-1,eu-west-1

# API Gateway โ€” REST & HTTP auth, WAF, JWT, CORS
python3 aws_agent.py scan-apigw
python3 aws_agent.py scan-apigw --regions us-east-1,us-west-2

# Cognito โ€” Unauthenticated pools, MFA, app clients
python3 aws_agent.py scan-cognito
python3 aws_agent.py scan-cognito --regions us-east-1

# DynamoDB โ€” Encryption, streams, resource policy
python3 aws_agent.py scan-dynamodb
python3 aws_agent.py scan-dynamodb --regions us-east-1,eu-west-1

# SQS / SNS โ€” Public policies, endpoint leakage, SSE
python3 aws_agent.py scan-sqs-sns
python3 aws_agent.py scan-sqs-sns --regions us-east-1,ap-southeast-1

# CloudFormation โ€” Secret outputs, stack role privesc, drift
python3 aws_agent.py scan-cfn
python3 aws_agent.py scan-cfn --regions us-east-1,us-west-2

# Route53 / DNS โ€” Subdomain takeover, DNSSEC, NS hijack
python3 aws_agent.py scan-dns
python3 aws_agent.py scan-dns --region us-east-1

# CodeBuild / CodePipeline โ€” Plaintext env var secrets, buildspec creds, privileged mode
python3 aws_agent.py scan-codebuild
python3 aws_agent.py scan-codebuild --regions us-east-1,eu-west-1

# WAF โ€” Web ACL posture, missing managed rules, rate limit, logging
python3 aws_agent.py scan-waf
python3 aws_agent.py scan-waf --regions us-east-1,us-west-2

# SCP โ€” Organizations SCP coverage, missing critical deny actions
python3 aws_agent.py scan-scp

# Step Functions / EventBridge โ€” Public buses, cross-account rules, state machine secrets
python3 aws_agent.py scan-sfn
python3 aws_agent.py scan-sfn --regions us-east-1,eu-west-1

Audit Modes

Mode Scope Use Case
recon IAM, S3, SGs, EKS, Lambda, new modules Fast initial assessment
loot + Network, RDS, KMS, EBS, ECR, CloudTrail Sensitive data extraction
all Everything Full engagement audit
# Examples
python3 aws_agent.py audit --mode all --regions us-east-1,eu-west-1 --output /tmp/audit
python3 aws_agent.py audit --mode recon --auto-backdoor --verbose
python3 aws_agent.py exploit-iam --auto-assume-role --identity user/pentest-user
python3 aws_agent.py scan-dns --region us-east-1
python3 aws_agent.py scan-cfn --regions us-east-1,us-west-2
python3 aws_agent.py backdoor-create --dry-run
python3 aws_agent.py backdoor-create --user-name my-pentest-user

Screenshots

Audit Dashboard IAM Privilege Escalation S3 Scanner
Audit IAM S3
EKS Clusters Backdoor Creation Executive Report
EKS Backdoor Report

Report Structure

Every audit run produces a timestamped Markdown report in reports/ with 29 sections:

1.  Account Information
2.  IAM Identity & Access (privesc paths + PoC + detailed findings)
3.  STS Cross-Account Trust Analysis
4.  S3 Storage (buckets, website, git leaks, version history)
5.  Compute โ€” EC2
6.  Network Exposure & Security Groups
7.  Lambda Function Analysis
8.  EKS Cluster Analysis
9.  ECR Container Analysis
10. Instance Metadata (IMDS) & Credential Exposure
11. SSM-Managed EC2 (RCE Candidates)
12. RDS Databases & Snapshots
13. KMS / Secrets Manager / SSM Parameters
14. EBS Snapshot Exposure
15. CloudTrail Exfiltration Risks
16. Logging & Detection Posture
17. Amazon MQ / ActiveMQ
18. API Gateway Security
19. Cognito / Identity Pool Analysis
20. DynamoDB Security
21. SQS / SNS Security
22. CloudFormation Security
23. Route53 / DNS Security
24. CodeBuild / CodePipeline Secret Exposure
25. AWS WAF Rule Analysis
26. Service Control Policy (SCP) Audit
27. Step Functions / EventBridge Exposure
28. Consolidated Recommendations (sorted by severity)
29. Auto-Backdoor Capability Assessment

Key Findings & PoC Examples

Severity Finding PoC
๐Ÿ”ด Critical IAM Action:* Resource:* aws iam create-user; aws iam attach-user-policy --policy-arn .../AdministratorAccess
๐Ÿ”ด Critical Route53 dangling CNAME Claim abandoned S3/EB/GitHub resource at same subdomain
๐Ÿ”ด Critical CloudFormation secret output aws cloudformation describe-stacks --query Stacks[].Outputs
๐Ÿ”ด Critical Cognito unauthenticated pool aws cognito-identity get-id ...; get-credentials-for-identity
๐Ÿ”ด Critical CodeBuild plaintext AWS_SECRET_ACCESS_KEY env var aws codebuild batch-get-projects --names <proj> โ†’ read env vars directly
๐ŸŸ  High WAF Web ACL with no rules All traffic reaches origin unfiltered โ€” exploit any web vulnerability directly
๐ŸŸ  High SCP missing cloudtrail:DeleteTrail deny aws cloudtrail delete-trail --name <trail> โ†’ silent log destruction
๐ŸŸ  High Account not in AWS Organization No preventative guardrails โ€” a single IAM misconfiguration = full compromise
๐ŸŸ  High Cross-account role, no ExternalId aws sts assume-role --role-arn <ARN> --role-session-name pentest
๐ŸŸ  High API Gateway no authorizer curl https://<api-id>.execute-api.<region>.amazonaws.com/<stage>/
๐ŸŸ  High SQS public SendMessage policy aws sqs send-message --queue-url <URL> --message-body '{"action":"inject"}'
๐ŸŸ  High Public EBS snapshot aws ec2 copy-snapshot --source-snapshot-id snap-xxx โ†’ attach โ†’ mount
๐ŸŸก Medium WAF default action ALLOW Unmatched requests pass through โ€” combine with any unpatched app vuln
๐ŸŸก Medium CodeBuild privileged mode Container escape via Docker socket โ†’ host access
๐ŸŸก Medium Cognito MFA optional Social-engineering โ†’ account takeover without MFA
๐ŸŸก Medium DynamoDB unencrypted + stream Stream consumer can read all table data as it changes
๐ŸŸก Medium CloudFormation stack drift Resources modified out-of-band, IaC state is unreliable

Project Structure

aws-pentest/
โ”œโ”€โ”€ aws_agent.py              # CLI entrypoint โ€” 16 commands
โ”œโ”€โ”€ core/
โ”‚   โ”œโ”€โ”€ session_manager.py    # Multi-region boto3 session management
โ”‚   โ”œโ”€โ”€ orchestrator.py       # 30-module scan pipeline
โ”‚   โ””โ”€โ”€ reporter.py           # 29-section Markdown report generator
โ”œโ”€โ”€ modules/
โ”‚   โ”œโ”€โ”€ account.py            # [00] Account & identity context
โ”‚   โ”œโ”€โ”€ iam.py                # [01] IAM privilege escalation
โ”‚   โ”œโ”€โ”€ s3.py                 # [02] S3 access control
โ”‚   โ”œโ”€โ”€ s3_website.py         # [02] S3 website hijack
โ”‚   โ”œโ”€โ”€ s3_subdomain.py       # [11] Subdomain enumeration
โ”‚   โ”œโ”€โ”€ s3_git_detector.py    # [12] Git artifact detection
โ”‚   โ”œโ”€โ”€ s3_versions.py        # [17] Version history / secret recovery
โ”‚   โ”œโ”€โ”€ compute.py            # [03] EC2 multi-region enum
โ”‚   โ”œโ”€โ”€ network_sg.py         # [04] Security group analysis
โ”‚   โ”œโ”€โ”€ network_enum.py       # [04] Network endpoint enumeration
โ”‚   โ”œโ”€โ”€ logging.py            # [05] CloudTrail / Config / GuardDuty
โ”‚   โ”œโ”€โ”€ rds.py                # [06] RDS findings
โ”‚   โ”œโ”€โ”€ rds_enum.py           # [06] RDS enumeration
โ”‚   โ”œโ”€โ”€ kms_secrets.py        # [06] KMS / Secrets Manager
โ”‚   โ”œโ”€โ”€ lambda_analysis.py    # [07] Lambda security
โ”‚   โ”œโ”€โ”€ eks_analysis.py       # [08] EKS cluster posture
โ”‚   โ”œโ”€โ”€ cloudtrail_exfil.py   # [09] CloudTrail exfiltration
โ”‚   โ”œโ”€โ”€ ebs_snapshots.py      # [10] EBS snapshot exposure
โ”‚   โ”œโ”€โ”€ ecr_analysis.py       # [13] ECR container analysis
โ”‚   โ”œโ”€โ”€ iam_backdoor.py       # [14] IAM backdoor persistence
โ”‚   โ”œโ”€โ”€ imds_enum.py          # [15] IMDS / instance metadata
โ”‚   โ”œโ”€โ”€ ssm_ec2.py            # [16] SSM-managed EC2
โ”‚   โ”œโ”€โ”€ mq_enum.py            # [18] Amazon MQ / ActiveMQ
โ”‚   โ”œโ”€โ”€ sts_cross_account.py  # [19] STS cross-account trust
โ”‚   โ”œโ”€โ”€ api_gateway.py        # [20] API Gateway security
โ”‚   โ”œโ”€โ”€ cognito.py            # [21] Cognito / Identity Pool
โ”‚   โ”œโ”€โ”€ dynamodb.py           # [22] DynamoDB security
โ”‚   โ”œโ”€โ”€ sqs_sns.py            # [23] SQS / SNS security
โ”‚   โ”œโ”€โ”€ cloudformation.py     # [24] CloudFormation security
โ”‚   โ”œโ”€โ”€ route53.py            # [25] Route53 / DNS security
โ”‚   โ”œโ”€โ”€ codebuild_pipeline.py # [26] CodeBuild / CodePipeline secrets
โ”‚   โ”œโ”€โ”€ waf_analysis.py       # [27] AWS WAF v2 rule analysis
โ”‚   โ”œโ”€โ”€ scp_audit.py          # [28] SCP / Organizations governance
โ”‚   โ””โ”€โ”€ stepfunctions_eventbridge.py  # [29] Step Functions / EventBridge exposure
โ”œโ”€โ”€ reports/                  # Generated audit reports (gitignored)
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ tools/
    โ””โ”€โ”€ convert_report.py     # Markdown โ†’ HTML / PDF conversion

Sample Console Output

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚  AWS Cloud Security Audit                             โ”‚
โ”‚  Profile: default/env  Region: us-east-1             โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

              Audit Summary
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Module                          โ”ƒ Result                โ”ƒ Risk                         โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ Account                         โ”‚ 123456789012          โ”‚                              โ”‚
โ”‚ IAM Users / Roles               โ”‚ 4 users / 12 roles    โ”‚ ๐Ÿ”ด 2 CRITICAL                โ”‚
โ”‚ S3 Buckets                      โ”‚ 8 total               โ”‚ ๐Ÿ”ด 3 public                  โ”‚
โ”‚ S3 Versioning / Secrets         โ”‚ 5 versioned           โ”‚ ๐ŸŸ  2 suspicious              โ”‚
โ”‚ EC2 Instances                   โ”‚ 6                     โ”‚                              โ”‚
โ”‚ Lambda Functions                โ”‚ 14                    โ”‚                              โ”‚
โ”‚ Lambda Security Issues          โ”‚ 3                     โ”‚ ๐ŸŸ  3 functions               โ”‚
โ”‚ EKS Clusters                    โ”‚ 2                     โ”‚ ๐ŸŸ  1 public API              โ”‚
โ”‚ MQ Brokers                      โ”‚ 1                     โ”‚ โœ…                           โ”‚
โ”‚ SG Admin Ports Exposed          โ”‚ 2                     โ”‚ ๐Ÿ”ด 2                         โ”‚
โ”‚ Logging / GuardDuty             โ”‚ CloudTrail: โœ… GD: ๐Ÿ”ด โ”‚                              โ”‚
โ”‚ STS Cross-Account Roles         โ”‚ 8 cross-acct          โ”‚ ๐ŸŸ  3 risky                   โ”‚
โ”‚ API Gateway APIs                โ”‚ 5 APIs                โ”‚ ๐ŸŸ  2 risky                   โ”‚
โ”‚ Cognito Pools                   โ”‚ 2 user / 1 identity   โ”‚ ๐Ÿ”ด 1 unauthenticated         โ”‚
โ”‚ DynamoDB Tables                 โ”‚ 9                     โ”‚ ๐ŸŸ  4 risky                   โ”‚
โ”‚ SQS / SNS Resources             โ”‚ 12 resources          โ”‚ ๐ŸŸ  2 risky                   โ”‚
โ”‚ CloudFormation Stacks           โ”‚ 23                    โ”‚ ๐Ÿ”ด 1 secret outputs          โ”‚
โ”‚ Route53 Zones                   โ”‚ 3                     โ”‚ ๐Ÿ”ด 2 takeover candidates     โ”‚
โ”‚ CodeBuild Projects              โ”‚ 4                     โ”‚ ๐Ÿ”ด 2 plaintext secrets       โ”‚
โ”‚ WAF Web ACLs                    โ”‚ 2                     โ”‚ ๐ŸŸ  1 no rules                โ”‚
โ”‚ SCP / Organizations             โ”‚ not in org            โ”‚ ๐ŸŸ  no guardrails             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Report saved: reports/aws_audit_report_20260410_120001.md

Critical Findings:
  ๐Ÿ”ด 2 CRITICAL IAM wildcard policies (full admin equivalent)
  ๐Ÿ”ด 3 publicly accessible S3 bucket(s)
  ๐Ÿ”ด 2 subdomain takeover candidate(s) in Route53
  ๐Ÿ”ด 1 CloudFormation stack output(s) with potential secret exposure
  ๐Ÿ”ด 1 Cognito identity pool(s) with unauthenticated access
  ๐Ÿ”ด 2 CodeBuild project(s) with plaintext secret env vars
  ๐ŸŸ  WAF: 1 Web ACL with no rules (zero protection)
  ๐ŸŸ  Account not in AWS Organization โ€” no SCP guardrails
  ๐ŸŸ  GuardDuty not enabled

Security Coverage Map

Category Modules MITRE ATT&CK Tactics
Identity & Access IAM, STS, Cognito TA0004 (Privilege Escalation), TA0003 (Persistence)
Storage S3, EBS, S3-Versions TA0009 (Collection), TA0010 (Exfiltration)
Compute EC2, Lambda, EKS, SSM, IMDS TA0002 (Execution), TA0008 (Lateral Movement)
Networking SG, Network Enum, Route53 TA0043 (Reconnaissance), TA0011 (C2)
Serverless / APIs Lambda, API Gateway TA0001 (Initial Access), TA0004 (Privesc)
Data Stores RDS, DynamoDB, KMS, Secrets TA0009 (Collection), TA0006 (Credential Access)
Messaging SQS, SNS, MQ TA0009 (Collection), TA0001 (Initial Access)
IaC / Logging CloudFormation, CloudTrail, Config, GuardDuty TA0005 (Defense Evasion)
Containers ECR, EKS TA0002 (Execution), TA0004 (Privesc)
CI/CD Pipeline CodeBuild, CodePipeline TA0006 (Credential Access), TA0003 (Persistence)
WAF / Perimeter WAF v2 (Regional + CloudFront) TA0001 (Initial Access), TA0005 (Defense Evasion)
Governance SCP / AWS Organizations TA0005 (Defense Evasion), TA0040 (Impact)
Event-Driven Step Functions, EventBridge TA0009 (Collection), TA0008 (Lateral Movement)

Requirements

pip install boto3 botocore click rich python-dotenv

Python โ‰ฅ 3.8, AWS credentials with at minimum ReadOnlyAccess (Security Auditor role recommended).


Roadmap

  • IAM Privilege Escalation Detection
  • S3 Misconfiguration Analysis
  • Multi-Region Compute Enumeration
  • Network Security Group Analysis
  • Logging & Detection Posture
  • RDS / KMS / Secrets Enumeration
  • Lambda Function Analysis
  • EKS Cluster Posture
  • CloudTrail Exfiltration Analytics
  • EBS Snapshot Exposure
  • S3 Subdomain Enumeration
  • Git Repo Detector
  • ECR Container Analysis
  • IAM Backdoor / Persistence Generator
  • IMDS / Instance Metadata Enumeration
  • SSM-Managed EC2 Enumeration
  • S3 Versioning / Secret History
  • Amazon MQ / ActiveMQ Enumeration
  • STS Cross-Account Trust Analysis
  • API Gateway Security Assessment
  • Cognito / Identity Pool Analysis
  • DynamoDB Security Analysis
  • SQS / SNS Security Analysis
  • CloudFormation Stack Security
  • Route53 / DNS Security (Subdomain Takeover, DNSSEC)
  • WAF Rule Analysis
  • Secrets in CodeBuild / CodePipeline
  • Service Control Policy (SCP) Audit
  • Step Functions / EventBridge Exposure

๐ŸŽฏ Professional Security Audit

Category Status SAST Coverage
๐Ÿ”ด IAM Backdoor โœ… PASS Critical Review
๐Ÿ”ด IAM Privesc โœ… PASS Privesc Analysis
๐Ÿ”ด STS Cross-Account โœ… PASS Trust Analysis
๐ŸŸก S3 Misconfiguration โœ… PASS S3 Analysis
๐ŸŸก S3 Versioning History โœ… PASS Secret History
๐ŸŸก S3 Subdomain Enum โœ… PASS Takeover Analysis
๐ŸŸก API Gateway โœ… PASS Auth Review
๐ŸŸก Cognito / Identity Pool โœ… PASS Identity Review
๐ŸŸก Lambda Functions โœ… PASS Lambda Analysis
๐ŸŸก RDS / KMS / Secrets โœ… PASS Secrets Analysis
๐ŸŸก CloudFormation โœ… PASS Stack Review
๐ŸŸก EKS Cluster โœ… PASS EKS Posture
๐ŸŸข Network Security Groups โœ… PASS Network Analysis
๐ŸŸข Multi-Region Compute โœ… PASS Compute Enum
๐ŸŸข Logging Posture โœ… PASS Detection Review
๐ŸŸข CloudTrail Exfiltration โœ… PASS Exfil Analytics
๐ŸŸข EBS Snapshots โœ… PASS Snapshot Review
๐ŸŸข ECR Containers โœ… PASS Container Review
๐ŸŸข IMDS Enumeration โœ… PASS IMDS Review
๐ŸŸข SSM-Managed EC2 โœ… PASS SSM Review
๐ŸŸข Amazon MQ / ActiveMQ โœ… PASS Broker Review
๐ŸŸข Git Repo Detector โœ… PASS Git Review
๐ŸŸข DynamoDB โœ… PASS DynamoDB Review
๐ŸŸข SQS / SNS โœ… PASS Queue Review
๐ŸŸข Route53 / DNS โœ… PASS DNS Review
๐ŸŸข Master Audit โœ… PASS Full Methodology
๐Ÿ”ด CodeBuild / CodePipeline โœ… PASS codebuild_pipeline.py
๐Ÿ”ด WAF Rule Analysis โœ… PASS waf_analysis.py
๐Ÿ”ด SCP / Organizations โœ… PASS scp_audit.py

Complete SAST Suite (30 modules): https://github.com/capture0x/aws-pentest-sast

Warnings

โš ๏ธ Authorized use only. Run only against accounts you own or have explicit written permission to test.
โš ๏ธ backdoor-create creates real persistent IAM users with AdministratorAccess. Use --dry-run first.
โš ๏ธ exploit-iam --auto-assume-role makes live STS API calls that appear in CloudTrail.
โš ๏ธ Route53 CNAME resolution checks make real DNS queries to external resolvers.


Contributing ยท License

MIT License โ€” See LICENSE.

โญ Star if useful ยท ๐Ÿ› Report issues ยท ๐Ÿ’ช Contribute modules

Created by tmrswrr โค๏ธ

About

Professional AWS pentest tool: IAM privilege escalation, S3 exploits, compute enumeration, detailed audit reports

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages