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

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: 4a0a004730450220589eecba207bd37070f3810a48ab99322c121868ec8d16cda81a507ad3258ec302210094f3f14a88fea35c3c3f8fb000fbaf06acf89a8f5d17bc5f319a66ade981015c:922c64590222798bb761d5b6d8e72950