Files
nuclei-templates/javascript/audit/webserver/apache/disable-http-trace-method.yaml
2025-03-11 01:56:01 +05:30

56 lines
1.4 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://httpd.apache.org/docs/2.4/mod/core.html#traceenable
metadata:
verified: true
tags: audit,config,auth,apache
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