Cloud Testing

Resources

AWS

Credential Types

IAM Enumeration

EC2 Instance Metadata (IMDS)

Secrets Locations

Shadow Resources

Cognito

Detection Avoidance

MFA CLI Session

S3 Enumeration

STS AssumeRole

Automated Enumeration Tools

Azure

CLI Basics

Key Vault

Metadata Service

Automated Enumeration

Permission Model

Secrets Locations

GCP

CLI Basics

Metadata

IAM Enumeration

Domain-Wide Delegation (DWD)

Post-Exploitation

Privesc Resources

Kubernetes

What is Kubernetes?

Commands

Service Account Tokens

APISERVER=https://kubernetes.default.svc
SERVICEACCOUNT=/var/run/secrets/kubernetes.io/serviceaccount
NAMESPACE=$(cat ${SERVICEACCOUNT}/namespace)
TOKEN=$(cat ${SERVICEACCOUNT}/token)
CACERT=${SERVICEACCOUNT}/ca.crt
curl --cacert ${CACERT} --header "Authorization: Bearer ${TOKEN}" -X GET ${APISERVER}/api

RBAC

Privilege Escalation

  1. List secrets and steal tokens for privileged service accounts
  2. Use create pods/exec to run commands in pods with privileged service accounts
  3. Abuse bind, escalate, or impersonate verbs
  4. Create a Bad Pod: mount host filesystem, read all pod filesystems on the node, steal service account tokens
  5. Use IMDS from within a pod (if exposed) to get node IAM creds, then mint tokens for any service account on that node

Network Policies

Admission Controllers

Testing IMDS from a Pod

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/instance-id

Container Escapes

CI/CD to K8s Pivoting

GKE Specific

EKS Specific

Useful jq Queries

IaC Review

Terraform