Cloud Reconnaissance
Before attacking a cloud infrastructure you must discover what the organization uses and what it has exposed: which provider, which public resources (buckets, functions, APIs), which domains point to cloud services, and which credentials they’ve leaked. Much of it is passive recon (see Passive Reconnaissance), but here it’s specifically aimed at identifying and enumerating cloud assets.
Identify the provider and assets
Section titled “Identify the provider and assets”# DNS/CNAME reveal the providerdig CNAME target.com # *.amazonaws.com, *.azurewebsites.net, *.cloudfront.net...# provider IP ranges (knowing whether an IP is AWS/Azure/GCP)# certificates (crt.sh) and web fingerprint (recon-fingerprint)# headers: Server, x-amz-*, x-azure-*, x-goog-*curl -sI https://target.com | grep -iE 'amz|azure|goog|cloudfront|server'Public buckets and storage (see Buckets and Public Storage)
Section titled “Public buckets and storage (see Buckets and Public Storage)”# name patterns: target-backups, target-dev, target-assets...# AWS S3https://<bucket>.s3.amazonaws.com# Azure Blobhttps://<account>.blob.core.windows.net/<container># GCShttps://storage.googleapis.com/<bucket># mass discovery toolscloud_enum -k target # searches buckets/blobs/GCS by keywordS3Scanner / GrayhatWarfare # public-bucket search enginesEnumeration of exposed cloud services
Section titled “Enumeration of exposed cloud services”# serverless functions, APIs, apps*.azurewebsites.net, *.lambda-url..., *.cloudfunctions.net, *.run.app (Cloud Run)# API Gateway, App Service, etc. -> fingerprint and paths (recon-content)# subdomains pointing to cloud services (recon-subdominios)Leaked credentials (vector #1)
Section titled “Leaked credentials (vector #1)”# in repos and code (see recon-code)trufflehog / gitleaks -> AWS keys (AKIA...), Azure secrets, GCP service account JSON# patternsAKIA[0-9A-Z]{16} AWS Access Key ID"type": "service_account" GCP service account key (JSON)# in .env, logs, dumps, PastebinA leaked AWS key or service account JSON is direct access — the most impactful and frequent cloud finding.
Authenticated enumeration (with credentials)
Section titled “Authenticated enumeration (with credentials)”If you get credentials, enumerate what you are and what you can do:
# AWSaws sts get-caller-identity # who am I?aws iam get-account-authorization-details # policies (if permitted)enumerate-iam / pacu # what permissions I actually have# Azureaz account show ; az ad signed-in-user showROADrecon / AzureHound # enumerate the tenant# GCPgcloud auth list ; gcloud projects listID and tenant enumeration (without credentials)
Section titled “ID and tenant enumeration (without credentials)”# AWS Account ID from a bucket/ARN/error# Azure tenant: https://login.microsoftonline.com/<domain>/.well-known/openid-configuration# validate whether a domain uses Azure/O365 (see cloud-m365)For the defense
Section titled “For the defense”- Don’t expose resources publicly by default; unpredictable bucket names aren’t a defense (use policies).
- Monitor credential leaks (secret scanning in repos, GitHub push protection).
- Reduce the surface: don’t leave dev functions/APIs/services reachable; review DNS/CNAME pointing to cloud.
- CSPM/ASM to inventory exposed cloud assets continuously.
- Immediately rotate any credential that may have leaked.
Testing checklist
Section titled “Testing checklist”- Identify the provider(s) by DNS/CNAME/headers
- Discover buckets/blobs/GCS (cloud_enum, GrayhatWarfare)
- Enumerate exposed serverless/apps/APIs
- Look for leaked credentials (trufflehog/gitleaks)
- With credentials: identity and permissions (sts/az/gcloud)
- Account ID / tenant ID identified
- Automated auditing (ScoutSuite/Prowler)
- Inventory cloud assets for the attack phase