Files
nuclei-templates/javascript/audit/webserver/apache/disable-http-trace-method.yaml
2025-04-09 16:01:27 +05:30

57 lines
1.5 KiB
YAML

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 # apache2 Debian
- /etc/httpd/conf/httpd.conf # apache RHEL
- /etc/httpd/conf.d # apache Virtual Host
- /usr/local/etc/httpd/httpd.conf # macos
matchers:
- type: dsl
dsl:
- "success == true"
extractors:
- type: dsl
dsl:
- response