id: dir-listing

info:
  name: Directory listing enabled
  author: _harleo,pentest_swissky,hczdmr
  severity: info
  reference:
    - https://portswigger.net/kb/issues/00600100_directory-listing
  classification:
    cwe-id: CWE-548
  metadata:
    max-request: 1
  tags: miscellaneous,misc,generic,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}"

    matchers:
      - type: word
        part: body
        words:
          - "Directory listing for "
          - "Index of /"
          - "[To Parent Directory]"
          - "Directory: /"
        condition: or
        case-insensitive: true

      - type: regex
        part: body
        regex:
          - '\d{1,2}\/\d{1,2}\/\d{4}\s+\d+:\d+\s+[\sAPM]+(&lt;dir&gt;|\d+)\s+<[Aa]\s+[hH][rR][eE][fF]="\/'
          - '\s+-\s+\/<\/(title|h1)>'
        condition: and
# digest: 4a0a0047304502206c2ecf98cab61b0a555e11975629517c28da2aa306e9119a84174ff9e0a6f807022100ac68ce8ee30528fcde63de5903c7e1aa453b53e0061cb39127cfa4cc45d58e9c:922c64590222798bb761d5b6d8e72950