Log4j Shell POC 项目使用文档
2024-08-10 19:14:41作者:乔或婵
1. 项目的目录结构及介绍
log4j-shell-poc/
├── Dockerfile
├── LICENSE
├── README.md
├── poc.py
├── requirements.txt
└── vulnerable-application/
├── Dockerfile
├── README.md
├── index.jsp
├── log4j2.xml
└── web.xml
- Dockerfile: 用于构建 Docker 镜像的文件。
- LICENSE: 项目许可证文件。
- README.md: 项目说明文档。
- poc.py: 证明概念(POC)的 Python 脚本,用于测试 Log4j 问题。
- requirements.txt: Python 依赖文件。
- vulnerable-application/: 包含测试用 Web 应用程序的文件夹。
- Dockerfile: 用于构建测试用 Web 应用程序的 Docker 镜像。
- README.md: 测试用 Web 应用程序的说明文档。
- index.jsp: 测试用 Web 应用程序的主页文件。
- log4j2.xml: Log4j 配置文件。
- web.xml: Web 应用程序的配置文件。
2. 项目的启动文件介绍
poc.py
poc.py 是用于测试 Log4j 问题的概念验证脚本。它可以通过以下命令运行:
python poc.py --userip <用户IP> --webport <HTTP端口> --lport <Netcat端口>
--userip: 用于 LDAPRefServer 和 Shell 的 IP 地址。--webport: HTTP 监听端口。--lport: Netcat 端口。
Dockerfile
Dockerfile 用于构建 Docker 镜像,可以通过以下命令构建和运行:
docker build -t log4j-shell-poc .
docker run --network host log4j-shell-poc
3. 项目的配置文件介绍
log4j2.xml
log4j2.xml 是 Log4j 的配置文件,定义了日志记录的行为和格式。以下是一个示例配置:
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="error">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
web.xml
web.xml 是 Web 应用程序的配置文件,定义了应用程序的部署描述符。以下是一个示例配置:
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<servlet>
<servlet-name>HelloServlet</servlet-name>
<servlet-class>HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloServlet</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
</web-app>
以上是 Log4j Shell POC 项目的使用文档,包含了项目的目录结构、启动文件和配置文件的介绍。希望这些信息能帮助你更好地理解和使用该项目。
登录后查看全文
热门项目推荐
相关项目推荐
暂无数据
项目优选
收起
deepin linux kernel
C
27
11
OpenHarmony documentation | OpenHarmony开发者文档
Dockerfile
540
3.77 K
Ascend Extension for PyTorch
Python
351
415
本项目是CANN提供的数学类基础计算算子库,实现网络在NPU上加速计算。
C++
889
612
openEuler内核是openEuler操作系统的核心,既是系统性能与稳定性的基石,也是连接处理器、设备与服务的桥梁。
C
338
185
openJiuwen agent-studio提供零码、低码可视化开发和工作流编排,模型、知识库、插件等各资源管理能力
TSX
987
253
openGauss kernel ~ openGauss is an open source relational database management system
C++
169
233
暂无简介
Dart
778
193
🎉 (RuoYi)官方仓库 基于SpringBoot,Spring Security,JWT,Vue3 & Vite、Element Plus 的前后端分离权限管理系统
Vue
1.35 K
758
华为昇腾面向大规模分布式训练的多模态大模型套件,支撑多模态生成、多模态理解。
Python
115
141