Apache2 HTTP TRACE Method Vulnerability

漏洞信息

漏洞名称: Apache2 HTTP TRACE Method Vulnerability

漏洞类型: 配置问题

漏洞等级: 高危

漏洞描述: Apache2是一款广泛使用的开源Web服务器软件,支持多种操作系统,常用于搭建网站和服务。其HTTP TRACE方法默认启用,可能导致安全风险。该漏洞属于配置问题,具体表现为未禁用HTTP TRACE方法,从而可能被利用进行跨站追踪(XST)攻击。攻击者可以通过TRACE方法获取用户的敏感信息,如Cookies和认证令牌,进而进行进一步的攻击。此漏洞的利用不需要认证,且可以远程执行,因此被评级为高危。为了防止此类攻击,建议在Apache配置文件中添加’TraceEnable Off’指令,并重启服务以确保配置生效。

产品厂商: Apache

产品名称: Apache2

来源: https://github.com/projectdiscovery/nuclei-templates/blob/804d1df949d5fbbfdee11564a2df65b6836a8d60/javascript%2Faudit%2Fwebserver%2Fapache%2Fdisable-http-trace-method.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
49
50
51
52
53
54
55
56
57
58
59
60

id: disable-http-trace-method

info:
name: Disable HTTP TRACE Method in Apache2
author: pussycat0x
severity: high
description: |
The HTTP TRACE method should be disabled to prevent Cross-Site Tracing (XST) attacks.
remediation: |
Add 'TraceEnable Off' in the Apache configuration file and restart the service.
reference:
- https://wiki.devsecopsguides.com/docs/checklists/apache/
- https://httpd.apache.org/docs/2.4/mod/core.html#traceenable
metadata:
verified: true
tags: audit,config,auth,apache,hardening

javascript:
- pre-condition: |
isPortOpen(Host,Port);
code: |
var m = require("nuclei/ssh");
var c = m.SSHClient();
c.Connect(Host,Port,User,Pass);
const ApacheConfig = c.Run(Code)
ApacheConfig
let result = "";
if (ApacheConfig.includes("<Directory") && !ApacheConfig.includes("TraceEnable On")) {
result += "Disable HTTP Trace Method";
} else {
exit();
}
result

args:
Host: "{{Host}}"
Port: "22"
User: "{{usernames}}"
Pass: "{{passwords}}"
Code: cat {{path}}

payloads:
path:
- /etc/apache2/apache2.conf
- /etc/httpd/conf/httpd.conf
- /etc/httpd/conf.d
- /usr/local/etc/httpd/httpd.conf

matchers:
- type: dsl
dsl:
- "success == true"

extractors:
- type: dsl
dsl:
- response
# digest: 4a0a0047304502210088b13c7e6bc409b009330a899317e4bbe9ba25a511aafc5496b4eb2f5bcdd52b02200713e96eabd9adfec3b73d3456ac592df7ecc9c36366e521020a4241de527ce0:922c64590222798bb761d5b6d8e72950


Apache2 HTTP TRACE Method Vulnerability
http://example.com/2025/07/27/github_1184121881/
作者
lianccc
发布于
2025年7月27日
许可协议