id: msexchange-eol

info:
  name: Microsoft Exchange Server End-of-Life - Detect
  author: Shivam Kamboj
  severity: info
  description: |
    Detected Microsoft Exchange Server versions that have reached End-of-Life (EOL) and no longer receive security updates.
  reference:
    - https://endoflife.date/msexchange
    - https://learn.microsoft.com/en-us/exchange/new-features/build-numbers-and-release-dates
  metadata:
    verified: true
    max-request: 2
    shodan-query: "X-OWA-Version"
  tags: tech,msexchange,eol

http:
  - method: GET
    path:
      - "{{BaseURL}}/owa/"
      - "{{BaseURL}}/owa/auth/logon.aspx"

    stop-at-first-match: true

    extractors:
      - type: regex
        part: header
        name: version
        group: 1
        regex:
          - '(?i)X-Owa-Version:\s*([0-9.]+)'
          - '(?i)X-Owa-Version["\'']?\s*[:=]\s*["\'']?([0-9.]+)'

      - type: regex
        part: body
        name: version
        group: 1
        regex:
          - '(?i)/owa/([0-9.]+)/'
          - '(?i)data-owa-version=["\'']([0-9.]+)'

    matchers:
      - type: dsl
        dsl:
          - 'len(version) > 0'
          - 'compare_versions(version, "<15.2.2562")'
        condition: and
# digest: 490a004630440220029d78a703b22581612c00c89db55bd1e0908dd59d3ef8fa0168466136961a7202202be3fdde48242926ab74f80cd3c528a1075f643c6b4aa34dcd15806b6698bf9f:922c64590222798bb761d5b6d8e72950