本文へ移動
cccskills
無料GitHub で公開

cloud-security

Use when attacking AWS/Azure/GCP cloud — IAM/identity privilege escalation, IMDS/metadata SSRF, Entra device-code & PRT theft, GCP impersonation chains, Kubernetes/container escape, IaC/CI-CD federation abuse

インストール方法を見る

含まれるファイル(13)

  • SKILL.md9.0 KB
  • references/aws-iam-privesc.md10.4 KB
  • references/azure-entra-attacks.md9.2 KB
  • references/gcp-attacks.md8.4 KB
  • references/iac-secrets-ci-cd.md7.7 KB
  • references/imds-metadata-ssrf.md8.7 KB
  • references/kubernetes-container-escape.md8.9 KB
  • scripts/aws_privesc_enum.py6.6 KB
  • scripts/entra_device_code_phish.py5.9 KB
  • scripts/gcp_impersonation_mapper.py6.7 KB
  • scripts/imds_harvester.py6.9 KB
  • scripts/k8s_can_i_abuse.py6.9 KB
  • scripts/oidc_trust_auditor.py7.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Cloud Security & Attack

When to Activate

  • Cloud penetration test / red team against AWS, Azure (Entra ID), or GCP
  • IAM / identity privilege escalation and cross-account or cross-tenant pivoting
  • Compromised web app or SSRF reachable from cloud compute — harvest metadata credentials
  • Kubernetes / container assessment, node breakout, cluster takeover
  • CI/CD and IaC review: Terraform state, OIDC federation trust policies, pipeline secrets
  • Post-exploitation: secret extraction, lateral movement, persistence in cloud control plane

Technique Map

TechniqueATT&CKCWEReferenceScript
AWS IAM privesc (CreatePolicyVersion, PassRole, AttachPolicy)T1098.001CWE-269references/aws-iam-privesc.mdscripts/aws_privesc_enum.py
AWS sts:AssumeRoot member-account escalationT1078.004CWE-269references/aws-iam-privesc.mdscripts/aws_privesc_enum.py
Cross-account confused deputy / missing ExternalIdT1078.004CWE-441references/aws-iam-privesc.mdscripts/oidc_trust_auditor.py
IMDS / metadata SSRF credential theft (AWS/Azure/GCP)T1552.005CWE-918references/imds-metadata-ssrf.mdscripts/imds_harvester.py
EKS node creds → IRSA / Pod Identity pivotT1552.007CWE-668references/imds-metadata-ssrf.mdscripts/imds_harvester.py
Entra device-code phishing → PRT / device joinT1528CWE-287references/azure-entra-attacks.mdscripts/entra_device_code_phish.py
FOCI refresh-token family abuseT1550.001CWE-613references/azure-entra-attacks.mdscripts/entra_device_code_phish.py
Azure Managed Identity / App-Admin → SP escalationT1098.001CWE-269references/azure-entra-attacks.mdscripts/imds_harvester.py
GCP actAs + resource create impersonation chainT1078.004CWE-269references/gcp-attacks.mdscripts/gcp_impersonation_mapper.py
GCP serviceAccountTokenCreator token chainsT1528CWE-269references/gcp-attacks.mdscripts/gcp_impersonation_mapper.py
Vertex AI P4SA / Ray head-node escalationT1078.004CWE-732references/gcp-attacks.mdscripts/gcp_impersonation_mapper.py
Container escape (runc Leaky Vessels CVE-2024-21626)T1611CWE-668references/kubernetes-container-escape.md-
IngressNightmare (CVE-2025-1974) cluster takeoverT1190CWE-94references/kubernetes-container-escape.mdscripts/k8s_can_i_abuse.py
K8s RBAC privesc (pods/exec, token mount, node proxy)T1078CWE-269references/kubernetes-container-escape.mdscripts/k8s_can_i_abuse.py
Terraform state secret extractionT1552.001CWE-312references/iac-secrets-ci-cd.mdscripts/oidc_trust_auditor.py
OIDC federation trust-policy abuse (GitHub/TF Cloud)T1199CWE-441references/iac-secrets-ci-cd.mdscripts/oidc_trust_auditor.py

Quick Start

# --- 0. Identify where you are ---
aws sts get-caller-identity                       # AWS
az account show && az ad signed-in-user show      # Azure
gcloud auth list && gcloud config get-value project  # GCP

# --- 1. AWS: enumerate then map privesc paths ---
python3 scripts/aws_privesc_enum.py --profile compromised --json paths.json
cloudfox aws --profile compromised all-checks      # alt: broad inventory
pacu  # > run iam__enum_permissions ; run iam__privesc_scan

# --- 2. SSRF / metadata: harvest creds from a reachable compute target ---
python3 scripts/imds_harvester.py --ssrf "https://app/fetch?url=" --provider aws
python3 scripts/imds_harvester.py --local --provider azure --resource https://vault.azure.net/

# --- 3. Azure Entra: device-code phish for tokens (authorized phishing only) ---
python3 scripts/entra_device_code_phish.py --resource https://graph.microsoft.com \
    --client-id 29d9ed98-a469-4536-ade2-f981bc1d605e   # Auth Broker -> PRT path

# --- 4. GCP: build the service-account impersonation graph ---
python3 scripts/gcp_impersonation_mapper.py --project TARGET --out gcp_graph.json

# --- 5. Kubernetes: what can this token do, and can we break out? ---
python3 scripts/k8s_can_i_abuse.py --kubeconfig ./kubeconfig
kubectl auth can-i --list ; peirates

# --- 6. CI/CD + IaC: audit federation trust + dump state secrets ---
python3 scripts/oidc_trust_auditor.py --profile compromised
aws s3 cp s3://tf-state/prod/terraform.tfstate - | jq '.. | .password? // empty'

OPSEC & Detection (summary)

TechniqueTelemetry / IOCDetection (Sigma / EDR / cloud)OPSEC note
IAM privesc API callsCloudTrail CreatePolicyVersion, AttachUserPolicy, CreateLoginProfileAlert on IAM write by non-IAM-admin principal; GuardDuty PrivilegeEscalation:IAMUser/*Use existing admin sessions; avoid bulk enum that trips anomaly detection
sts:AssumeRootCloudTrail AssumeRoot (regional only)Elastic "AssumeRoot by Rare User and Member Account" (new-terms rule)Rare-event detection fires on first use per (principal, member account)
IMDS SSRFVPC flow to 169.254.169.254 from web tier; STS use from new ASNGuardDuty UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration* (creds used off-instance)Use creds from same egress IP where possible; creds expire — refresh fast
Entra device-code phishSign-in logs authenticationProtocol=deviceCode; Auth Broker client 29d9ed98-...; new device registrationSentinel device-code anomaly; CA "block device code flow"Tokens valid even after password reset; device-join = MFA-resistant persistence
GCP impersonationGenerateAccessToken / generateAccessToken in Admin Activity + Data Access logsAlert on impersonation by principal lacking a documented chainRequires Data Access (DATA_READ) audit logs enabled to see token minting
Container escape (runc)New process from /proc/self/fd/* cwd; host binary writes; nsenter in containerFalco Container escape/Drop and execute new binary; runc ≤1.1.11 inventoryOverwrites host runc → noisy; prefer read-only host FS read for stealth
IngressNightmareNGINX ingress pod loads .so from /proc; outbound from controllerFalco/Sysdig "IngressNightmare" shared-lib load; ingress-nginx < 1.11.5/1.12.1Exploit hits admission webhook (often internal-only) — low external noise
OIDC trust abuseCloudTrail AssumeRoleWithWebIdentity from unexpected sub/repoAlert on web-identity assume with mismatched aud/sub; RCP blockWildcard sub (org:foo*) still exploitable; no creds needed

Deep Dives

  • references/aws-iam-privesc.md — Classic + 2024 IAM escalation chains, sts:AssumeRoot, cross-account confused deputy / ExternalId, Cognito, secrets harvesting; detection per API.
  • references/imds-metadata-ssrf.md — IMDSv1/v2 mechanics, SSRF bypasses, Azure & GCP metadata token theft, EKS node-cred → IRSA/Pod Identity lateral movement.
  • references/azure-entra-attacks.md — Storm-2372 device-code → PRT → device-join chain, FOCI token families, Managed Identity abuse, Application Administrator → service principal → Global Admin.
  • references/gcp-attacks.md — actAs + resource-create impersonation, serviceAccountTokenCreator chains, Cloud Functions takeover, Vertex AI ModeLeak/P4SA/Ray escalation.
  • references/kubernetes-container-escape.md — runc Leaky Vessels (CVE-2024-21626), privileged/hostPID/Docker-socket escapes, IngressNightmare (CVE-2025-1974), RBAC primitives, kubelet/etcd.
  • references/iac-secrets-ci-cd.md — Terraform state secret extraction, OIDC federation trust-policy abuse (GitHub Actions / Terraform Cloud), pipeline secret theft, RCP/SCP defenses.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Use when attacking a Windows Active Directory domain — Kerberos roasting/delegation, coercion + NTLM/Kerberos relay (CVE-2025-33073), ADCS ESC1-16 (EKUwu), ticket forgery & DCSync, dMSA BadSuccessor (CVE-2025-53779), BloodHound attack-path enumeration, domain dominance

日本語の概要は準備中です。原文の説明を表示しています。

hypnguyen1209/offensive-claude3892026年9月28日 更新

Use when red-teaming an agentic AI / LLM application — indirect & zero-click prompt injection, MCP tool poisoning, persistent memory poisoning, excessive-agency tool abuse, multi-turn jailbreaks, PyRIT/Garak/Promptfoo harnesses

日本語の概要は準備中です。原文の説明を表示しています。

hypnguyen1209/offensive-claude3892026年9月28日 更新

Use when attacking an AI/ML system or model — prompt injection & jailbreaks (Crescendo, Skeleton Key, Best-of-N), RAG/vector poisoning, agentic/MCP exploitation (CVE-2025-54136), ML supply-chain RCE (pickle CVE-2025-32434), model extraction / membership inference / adversarial suffixes (GCG)

日本語の概要は準備中です。原文の説明を表示しています。

hypnguyen1209/offensive-claude3892026年9月28日 更新

Use when building a client-side browser exploit — V8/JSC JIT type confusion to renderer R/W, V8 heap-sandbox escape, renderer-to-browser sandbox escape (Mojo IPC, GPU/Dawn/ANGLE), Electron/webview IPC abuse, 1-click RCE chains

日本語の概要は準備中です。原文の説明を表示しています。

hypnguyen1209/offensive-claude3892026年9月28日 更新

Use when attacking or auditing a CI/CD pipeline or software supply chain — pwn requests, poisoned pipeline execution, compromised/mutable-tag actions, dependency confusion, registry worms, runner backdoors, OIDC trust abuse, SLSA/provenance

日本語の概要は準備中です。原文の説明を表示しています。

hypnguyen1209/offensive-claude3892026年9月28日 更新

Use when writing security tooling, exploits, scanners, or C2 in Python/C/Go/Rust/ASM — systems & network programming, automation, cryptography implementation

日本語の概要は準備中です。原文の説明を表示しています。

hypnguyen1209/offensive-claude3892026年9月28日 更新

hypnguyen1209 のスキルをすべて見る

このスキルの問題を報告する