Cloud attack surface discovery

From xalgorix/xalgorix · View interactive version

Cloud attack surface discovery is an AI agent skill from the GitHub repository xalgorix/xalgorix. Black-box discovery of a target's cloud footprint from an ordinary internet-facing domain — DNS, CNAME, headers, TLS, JavaScript, CSP, and error evidence fingerprinted to AWS, Azure, and GCP services, resources, accounts/tenants/projects, and applicable attack methodology

How to use this skill

Skill file

Cloud Attack Surface Discovery (Black-Box)

Purpose

Derive a target's cloud attack model starting from only a domain or web application, using external evidence only. Output a provider/service/resource map that drives which offensive cloud skill to load next — not a "cloud detected" label.

Entry Conditions

Discovery Signals

| Source | What to extract |

|---|---|

| DNS / CNAME | *.amazonaws.com, *.cloudfront.net, *.azurewebsites.net, *.trafficmanager.net, *.run.app, *.cloudfunctions.net, *.firebaseapp.com, *.blob.core.windows.net |

| HTTP headers | x-amz-*, x-azure-*, Server: cloudfront, via: 1.1 google, x-served-by: cache-* |

| TLS certificates | SANs revealing internal hostnames, *.cloudapp.azure.com, load-balancer pool names |

| JavaScript / source maps | API endpoints, signed-URL generation, Cognito/AAD/Google client IDs, SDK usage |

| CSP / security headers | Allowed origins revealing S3/Azure/GCS buckets, API hosts |

| Static/image/upload URLs | Bucket hostnames, CDN origins, presigned URL patterns |

| Redirect destinations | OAuth flows revealing tenant IDs, app registrations |

| Error messages | Provider error XML/JSON (S3 AccessDenied, Azure AuthenticationFailed, GCP quota errors) exposing bucket/account names |

| robots/sitemaps/manifests | Hidden paths to API/storage resources |

Provider Fingerprints

AWS

amazonaws.com, s3.amazonaws.com / s3-website-*, execute-api.*.amazonaws.com (API Gateway), *.lambda-url.*.on.aws (Function URLs), cloudfront.net, elasticbeanstalk.com, *.elb.amazonaws.com, amplifyapp.com, Cognito pool IDs (us-east-1_XXXX, aws.cognito.* in JS), ECR public galleries, App Runner domains. Derive the 12-digit account ID where possible (S3 ARNs in presigned URLs, Lambda x-amz-invocation-* errors, resource policies).

Azure

azurewebsites.net (App Service/Functions), blob.core.windows.net / dfs.core.windows.net, azureedge.net, trafficmanager.net, cloudapp.azure.com, azure-api.net (APIM), *.vault.azure.net (Key Vault). Derive the tenant ID from OIDC metadata (https://login.microsoftonline.com/<tenant>/.well-known/openid-configuration — responds for valid tenants), app registration client IDs in JS.

GCP

storage.googleapis.com, *.appspot.com (App Engine/GCS), run.app (Cloud Run), *.cloudfunctions.net, googleapis.com endpoints, firebaseapp.com / Firebase config objects in JS, *.web.app. Derive the project ID from bucket names (gs://<project>-...), Firebase config, or API URLs.

Attack Model Output

For every discovered signal, record in the hypothesis ledger:

target hostname
→ provider (aws/azure/gcp)
→ cloud service (S3 / CloudFront / API Gateway / Blob / App Service / Cloud Run / ...)
→ candidate account ID / tenant ID / project ID
→ trust boundary implied (public resource? shared identity? delegated API?)
→ applicable offensive skill (cloud-storage-exposure-testing, serverless-cloud-security, cloud-credential-abuse, provider pentest skill)
→ next concrete probe

Fingerprints are reconnaissance signals, NOT vulnerabilities. A CloudFront header alone is never a finding.

Public Resource Discovery

With naming seeds from the target (company, domain, project names), probe for externally reachable resources — do not brute-force enormous global namespaces blindly:

Use target-derived seeds first; widen wordlists only when seeds are exhausted.

Methodology

Step 1: Collect External Evidence

dig +short CNAME target.com www.target.com cdn.target.com
dig +short TXT target.com            # sometimes reveals verification/infra hints
curl -sk -D- https://target.com -o /dev/null | grep -iE "x-amz|x-azure|server|via"
curl -sk https://target.com | grep -oE "https?://[a-zA-Z0-9.-]+\.(amazonaws|cloudfront|azurewebsites|blob\.core|run\.app|cloudfunctions|storage\.googleapis)[a-zA-Z0-9.-]*" | sort -u

Step 2: Expand via JavaScript and Crawl Data

# Pull all JS from recon output, extract cloud endpoints, client IDs, bucket names
grep -ohE "(cognito-idp\.[a-z0-9-]+\.amazonaws\.com|accounts\.google\.com/o/oauth2|login\.microsoftonline\.com/[a-f0-9-]{36})" js/*.js | sort -u
grep -ohE "gs://[a-z0-9-]+|https://[a-z0-9-]+\.blob\.core\.windows\.net/[^\"']*" js/*.js | sort -u

Step 3: Resolve Identity Anchors

Step 4: Probe Candidate Resources Anonymously

For each candidate resource: existence check → anonymous access check → hand off to cloud-storage-exposure-testing (storage), serverless-cloud-security (functions), or the provider pentest skill (everything else). Record every 401/403-vs-200 differential — existence is a candidate signal.

Step 5: Chain into Application Primitives

Where the web app has SSRF/file-read/injection primitives, chain into cloud-metadata-workload-identity. Where credentials appear in JS, configs, or source maps, chain into cloud-credential-abuse.

Evidence Contract

NOT evidence: "AWS detected", a CNAME to cloudfront.net, a TLS SAN, a public DNS record, a 403 from a bucket (candidate, not confirmed)

Common Misses

False Positives / Non-Findings

Xalgorix Tool Strategy

Specialist Handoffs

Stopping Rule

Stop broad enumeration once the provider/service mapping is stable, all target-associated resources found via seeds are tested, and no new high-confidence naming seeds have emerged in the last N probes. Depth-first on the strongest signal (an accessible resource beats ten 403 candidates).

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.