
Docker container to setup a vulnerable elfinder version on both nginx and apache servers. Can be used to test vulnerability POC
This repository contains a reproduction setup for CVE-2021-23394 (Arbitrary File Execution in elFinder) using Docker. It sets up four environments to compare vulnerable and patched versions across Apache and Nginx.
The setup includes:
8080): elFinder 2.1.57 on Apache8081): elFinder 2.1.66 on Apache8082): elFinder 2.1.57 on Nginx8083): elFinder 2.1.66 on NginxMake the setup script executable (if it isn't already):
chmod +x setup_containers.sh
Run the setup script:
./setup_containers.sh
This will build the Docker images and start the containers.
You can access the elFinder interface in your browser at:
To verify the vulnerability (or the fix), use Nuclei with the appropriate template.
Run the following commands (replace path-to-nuclei-templates with the actual path to your templates directory):
# Test Apache Vulnerable (should be vulnerable)
nuclei -t path-to-nuclei-templates/http/cves/2021/CVE-2021-23394.yaml -u http://localhost:8080
# Test Apache Patched (should NOT be vulnerable)
nuclei -t path-to-nuclei-templates/http/cves/2021/CVE-2021-23394.yaml -u http://localhost:8081
# Test Nginx Vulnerable (should be vulnerable)
nuclei -t path-to-nuclei-templates/http/cves/2021/CVE-2021-23394.yaml -u http://localhost:8082
# Test Nginx Patched (should NOT be vulnerable)
nuclei -t path-to-nuclei-templates/http/cves/2021/CVE-2021-23394.yaml -u http://localhost:8083
Alternatively, test all at once by creating a targets.txt file:
echo -e "http://localhost:8080\nhttp://localhost:8081\nhttp://localhost:8082\nhttp://localhost:8083" > targets.txt
nuclei -t path-to-nuclei-templates/http/cves/2021/CVE-2021-23394.yaml -l targets.txt
Expected Results:
To stop and remove the containers, you can run the cleanup command inside the script or manually:
docker rm -f elfinder-apache-vuln elfinder-apache-patched elfinder-nginx-vuln elfinder-nginx-patched