id: cgi-printenv

info:
  name: Test CGI Script - Detect
  author: emadshanab
  severity: medium
  description: Test CGI script was detected. Response page returned by this CGI script exposes a list of server environment variables.
  reference:
    - https://www.acunetix.com/vulnerabilities/web/test-cgi-script-leaking-environment-variables/
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
    cvss-score: 5.3
    cwe-id: CWE-200
  metadata:
    max-request: 1
  tags: exposure,cgi,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/cgi-bin/printenv.pl"

    matchers-condition: and
    matchers:
      - type: word
        words:
          - 'MYSQL_HOME'
          - 'OPENSSL_CONF'
          - 'REMOTE_ADDR'
          - 'SERVER_ADMIN'
          - 'Environment Variables:'
        condition: or

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