id: tomcat-directory-listing

info:
  name: Apache Tomcat - Directory Listing Enabled
  author: oleveloper
  severity: medium
  description: |
    Directory listing is enabled on the Apache Tomcat server, allowing users to view the contents of web directories.This could lead to unauthorized access to sensitive files and potential information disclosure.
  remediation: |
    Disable directory listings by setting the listings parameter to false in the web.xml under the DefaultServlet. This helps prevent unauthorized directory browsing and protects sensitive files.
  reference:
    - https://isms.kisa.or.kr
  metadata:
    verified: true
    max-request: 1
    vendor: apache
    product: tomcat
    shodan-query: title:"Apache Tomcat"
  tags: tomcat,misconfig,listing,kisa,vuln

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

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "Directory Listing For"
          - "<a href="
        condition: and

      - type: regex
        part: header
        regex:
          - "(?i)content-type:.*text/html"

      - type: status
        status:
          - 200
# digest: 4a0a00473045022026d8e5b730c31c9dae17f069527305605be084de10296ba8d1a23fe528e7507e022100a97e91e10654d7bf4b5aff7223d22a1a7eb399d3ebb01c0081dd47e28d0a1cef:922c64590222798bb761d5b6d8e72950