mirror of
https://github.com/projectdiscovery/nuclei-templates.git
synced 2026-02-02 16:53:25 +08:00
58 lines
1.6 KiB
YAML
58 lines
1.6 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
|
|
- /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 |