id: mismatched-ssl-certificate

info:
  name: Mismatched SSL Certificate
  author: pdteam
  severity: info
  description: |
    Mismatched certificates occur when there is inconsistency between the common name to which the certificate was issued and the domain name in the URL. This issue impacts the trust value of the affected website.
  reference:
    - https://www.invicti.com/web-vulnerability-scanner/vulnerabilities/ssl-certificate-name-hostname-mismatch/
  metadata:
    max-request: 1
  tags: ssl,tls,mismatched
ssl:
  - address: "{{Host}}:{{Port}}"
    matchers:
      - type: dsl
        dsl:
          - "mismatched == true"
          - "ip != host"
          - "!contains(host, 'enterpriseregistration.') && !contains(host, 'enterpriseenrollment.')"
        condition: and

    extractors:
      - type: dsl
        dsl:
          - '"CN: " + subject_cn'
# digest: 4b0a00483046022100e0487f3cf590d59ecd1e5971f471231ae3a1cc01413f220fa1728a272ecb92a3022100a63e1287674aef12feb20b21bacc38b08e5b25d949ce5707ea70cff77a06474a:922c64590222798bb761d5b6d8e72950