Aws cloud pentesting

From xalgorix/xalgorix · View interactive version

Aws cloud pentesting is an AI agent skill from the GitHub repository xalgorix/xalgorix. AWS offensive testing — account and principal identification, IAM enumeration, resource discovery across all regions (S3, EC2, ECS, Lambda, API Gateway, Secrets Manager, SSM, KMS, ECR, snapshots, Cognito, CloudFormation), with AWS CLI as the baseline and Pacu/CloudFox/ScoutSuite as optional accelera

How to use this skill

Skill file

AWS Cloud Pentesting

Purpose

Full AWS offensive methodology: from an identified AWS account/principal to mapped permissions, discovered resources, exposed data, and escalation/impact paths. Works black-box (via discovery chains) and credentialed (operator-supplied or discovered credentials).

Entry Conditions

Discovery Signals

Attack Model

identity/context established
→ permission enumeration (watch AccessDenied GAPS — they hide paths)
→ resource discovery across ALL regions
→ data exposure + credential harvesting
→ escalation candidates
→ verified impact

Methodology

Step 1: Identity and Boundaries

aws sts get-caller-identity
# user vs assumed-role; root keys: enumerate only, never destructive actions
aws iam list-attached-user-policies --user-name <u>
aws iam list-user-policies --user-name <u>          # inline
aws iam get-account-summary                          # global account posture hints
aws iam simulate-principal-policy --policy-source-arn <arn> --action-names "*"

Step 2: All-Region Resource Discovery

IAM, S3, and Secrets Manager naming are global; most everything else is regional. Region-scoped enumeration silently misses us-west-2/eu-* resources:

for r in us-east-1 us-east-2 us-west-1 us-west-2 eu-west-1 eu-central-1 ap-southeast-1 ap-southeast-2 ap-northeast-1 sa-east-1; do
  export AWS_DEFAULT_REGION=$r
  aws ec2 describe-instances --query "Reservations[].Instances[].InstanceId" --output text 2>/dev/null
  aws lambda list-functions --query "Functions[].FunctionName" --output text 2>/dev/null
  aws ecs list-clusters --output text 2>/dev/null
done
aws s3api list-buckets                                # global
aws secretsmanager list-secrets                       # global
aws ssm describe-parameters                           # global
aws ecr describe-repositories --region us-east-1

Step 3: Deep Enumeration on Findings

Step 4: Resource-Based Policies

S3/KMS/SNS/SQS/ECR/Lambda resource policies grant access identity policies never show:

aws s3api get-bucket-policy --bucket <b>
aws ecr get-repository-policy --repository-name <r>
aws kms get-key-policy --key-id <k> --policy-name default

Step 5: Chain

Tool Policy

AWS CLI + Python are the baseline. Optional accelerators:

Evidence Contract

candidate resource/permission (tool output or list call)
→ effective-access check (actual GET/read or simulate-principal-policy)
→ concrete data retrieved / action performed
→ report

NOT evidence: Pacu/ScoutSuite/Prowler findings without live reproduction, a 200 from a create-style call with no read-back, silent clean runs (permission gaps), a list-only view of resources with no access demonstrated

Common Misses

False Positives / Non-Findings

Xalgorix Tool Strategy

Specialist Handoffs

aws-iam-privilege-escalation, cloud-secrets-data-access, cloud-storage-exposure-testing, cloud-cross-account-tenant-trust, serverless-cloud-security, cloud-metadata-workload-identity (SSRF chains)

Stopping Rule

Stop when: caller identity and effective permissions are mapped, all-region resource discovery has completed (or all AccessDenied gaps are recorded), high-value secrets/data have been chased, and the strongest escalation candidates are verified or ruled out. Depth-first on live credentials and data over breadth-first listing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.