Merge pull request #10456 from kazet/no-http-host-directory-listing

Notifying if no HTTP Host header yields directory listing
patch-11
Ritik Chaddha 2024-09-10 15:03:29 +04:00 committed by GitHub
commit cea38a3160
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,43 @@
id: directory-listing-no-host-header
info:
name: Directory Listing - No Host header
author: kazet
severity: unknown
description: |
The HTTP server is configured to list files in the root directory when no Host header is provided.
metadata:
verified: true
max-request: 1
tags: misconfig,listing
flow: http(1) && http(2)
http:
- raw:
- |
GET / HTTP/1.1
Host: {{Hostname}}
matchers:
- type: dsl
dsl:
- '!contains_any(body,"<title>Index of","<title>Directory listing of")'
internal: true
- raw:
- |+
@Host: {{Hostname}}
GET / HTTP/1.0
unsafe: true
host-redirects: true
max-redirects: 2
matchers:
- type: dsl
dsl:
- 'contains_any(body,"<title>Index of","<title>Directory listing of")'
- 'status_code == 200'
condition: and