본문으로 건너뛰기
Skillpedia
보안5.5k · #14787

cloud-pentest

하는 일

이 스킬은 테스터가 이미 가진 클라우드 아이덴티티의 권한을 확인하는 방법을 에이전트에게 가르칩니다. 해당 아이덴티티가 접근할 수 있는 대상을 나열하고, 권한 상승 경로를 찾되 읽기 전용 단계부터 시작합니다.

사용하는 경우

  • ✓테스터가 클라우드 액세스 키나 메타데이터 토큰을 가지고 있고 그 권한 범위를 알아야 할 때.
  • ✓테스터가 클라우드 아이덴티티가 더 많은 권한을 얻을 수 있는지 확인해야 할 때.
  • ✓테스터가 고객 데이터를 건드리지 않고 클라우드 접근의 실제 영향을 보여야 하는 경우.

스킬 링크

https://github.com/awarexone/Agentic-Bug-Hunter/blob/main/skills/cloud-pentest/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/awarexone/Agentic-Bug-Hunter/blob/main/skills/cloud-pentest/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 테스트 범위에 포함된 AWS 액세스 키가 있습니다. 이 아이덴티티가 무엇을 할 수 있는지 읽기 전용으로 먼저 확인하도록 도와주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 먼저 읽기 전용 호출로 아이덴티티를 확인한 다음 권한을 나열합니다. 알려진 권한 상승 경로를 확인하고, 고객 데이터 대신 무해한 테스트 객체로 영향을 입증합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

CLOUD PENTEST — Post-Access Exploitation

Recon finds the door; this is what you do inside. A leaked AKIA... key or a metadata token is not a finding on its own — the finding is what that identity can DO. Enumerate the identity, find the privesc path, prove real impact. Never touch data you're not authorized to.


AUTHORIZATION FIRST

[ ] Target cloud account/subscription is explicitly in scope
[ ] You have written authorization (program scope, engagement doc)
[ ] Read-only enumeration before ANY state change
[ ] No exfil of real customer data — prove access with a benign canary/own-account object
[ ] Discovered accounts/roles you can pivot to are NOT auto-authorized — confirm scope

Stop here if any box is unchecked.


0. IDENTIFY THE IDENTITY (do this first, always)

You have First call Tells you
AWS keys aws sts get-caller-identity account id, principal ARN, user vs role
AWS metadata curl .../iam/security-credentials/<role> temp creds + role name
GCP SA JSON / token gcloud auth ... / curl metadata ...token project, service account, scopes
Azure token / MI IMDS .../identity/oauth2/token tenant, object id, resource access

Never assume privilege. Enumerate what this identity actually has before planning.


1. AWS — ENUMERATE THEN ESCALATE

Enumerate (read-only):

aws sts get-caller-identity
aws iam get-account-authorization-details 2>/dev/null   # full policy dump if allowed
aws iam list-attached-user-policies --user-name <u>
aws iam list-role-policies / list-attached-role-policies
# No IAM read? Brute the effective perms with enumerate-iam / then map with a policy tool

Classic privesc paths (need the matching permission):

Permission held Escalation
iam:CreatePolicyVersion Write a new default *:* version onto an attached policy
iam:PassRole + ec2:RunInstances / lambda:CreateFunction Launch compute AS an admin role
iam:AttachUserPolicy / PutUserPolicy Attach AdministratorAccess to yourself
sts:AssumeRole (over-broad trust) Assume a more privileged role
iam:CreateAccessKey on another user Mint keys for a privileged user
lambda:UpdateFunctionCode on privileged fn Run code with the function's role
iam:UpdateAssumeRolePolicy Rewrite trust policy to let you assume it

Impact proof (benign): list a bucket you were told is in scope, sts assume-role into the admin role and get-caller-identity to show the new ARN, or read a canary object. Don't touch real PII.


2. METADATA (IMDS) — SSRF LANDS HERE

IMDSv1 (no token): GET http://169.254.169.254/latest/meta-data/iam/security-credentials/<role>
IMDSv2 (token):    PUT .../latest/api/token  (X-aws-ec2-metadata-token-ttl-seconds: 21600)
                   then GET with  X-aws-ec2-metadata-token: <token>
GCP:  GET http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token
      header: Metadata-Flavor: Google
Azure: GET http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/
      header: Metadata: true

Got temp creds → jump to section 1 (AWS) / 3 (GCP) / 4 (Azure) and enumerate what THAT role can do. SSRF alone is Medium; SSRF → metadata creds → data/admin is Critical.


3. GCP — IMPERSONATION IS THE PIVOT

gcloud auth activate-service-account --key-file=sa.json   # or use the token
gcloud projects get-iam-policy <project>
gcloud iam service-accounts list
Permission Escalation
iam.serviceAccounts.getAccessToken / actAs Impersonate a higher-priv SA (--impersonate-service-account)
iam.serviceAccountKeys.create Mint a key for a privileged SA
iam.roles.update on a custom role you hold Add permissions to yourself
cloudfunctions.functions.update / deploy Run code as the function's SA
storage.objects.get on a sensitive bucket Read secrets/state

Owner/Editor at project level = effectively admin. Check for the default Compute SA having Editor — extremely common.


4. AZURE — MANAGED IDENTITY & RBAC

az account show
az role assignment list --assignee <objectId> --all
az resource list
Path Escalation
Managed identity with Contributor Deploy/modify resources, run commands on VMs (az vm run-command)
Microsoft.Authorization/*/write Assign yourself Owner
자주 묻는 질문

에이전트가 클라우드에서 무엇이든 바꿀 수 있나요?

아닙니다. 스킬은 상태를 바꾸는 작업 전에 반드시 읽기 전용으로 목록을 확인하고, 먼저 범위를 확인하라고 설명합니다.

고객 데이터를 증거로 사용하나요?

아닙니다. 스킬은 무해한 카나리 객체나 테스터 자신의 객체로 접근을 입증하라고 설명합니다.

유출된 키 자체가 발견 사항인가요?

아닙니다. 스킬은 발견 사항이 그 아이덴티티로 무엇을 할 수 있는지라고 설명합니다.

상세 정보

작성자의 원본 설명

Post-access cloud exploitation for AWS, GCP, and Azure — what to do AFTER you obtain credentials or reach a metadata endpoint. Covers IAM enumeration and privilege escalation (iam:PassRole, CreatePolicyVersion, AssumeRole chains, GCP service-account impersonation, Azure managed-identity abuse), IMDSv1/v2 metadata credential theft, STS token abuse, S3/GCS/Blob bucket takeover and object exfil, Lambda/Cloud Functions env-var secrets, cross-account and cross-service pivoting, and turning leaked keys into demonstrated impact (read PII, assume admin, exfil data). Assumes authorized scope only. Use

repo: awarexone/Agentic-Bug-Hunter

인기도

GitHub 스타
5.5k
순위
#14787
라이선스
MIT
업데이트
2026. 10. 28.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬