id: expressionengine-detect

info:
  name: ExpressionEngine Detection
  author: Chirag Mistry
  severity: info
  description: |
    An instance running ExpressionEngine is detected by looking for specific HTTP headers, HTML tags, and known endpoints.
  metadata:
    max-request: 9
  tags: expressionengine,detect,tech

http:
  - method: GET
    path:
      - "{{BaseURL}}"
      - "{{BaseURL}}/robots.txt"
      - "{{BaseURL}}/sitemap.xml"
      - "{{BaseURL}}/favicon.ico"
      - "{{BaseURL}}/system/"
      - "{{BaseURL}}/themes/"
      - "{{BaseURL}}/index.php"
      - "{{BaseURL}}/admin.php"
      - "{{BaseURL}}/cp/"

    stop-at-first-match: true
    matchers-condition: and
    matchers:
      - type: word
        part: response
        words:
          - "ExpressionEngine"
          - "Powered by ExpressionEngine"
          - "expressionengine.com"
          - "X-Powered-By-ExpressionEngine"
        condition: or
        case-insensitive: true

      - type: status
        status:
          - 200

    extractors:
      - type: regex
        part: body
        name: version
        regex:
          - 'ExpressionEngine ([0-9.]+)'
          - 'Powered by ExpressionEngine ([0-9.]+)'

      - type: regex
        part: body
        name: expressionengine_id
        regex:
          - 'expressionengine-site-id=([a-z0-9]+)'
          - 'expressionengine\.com/([^/]+)'
# digest: 480a00453043021f7113a0b6c392126db116121c28c9746f0a54e16b1cdddf0006b243c6873476022049ee56540eb15f3343892ff75012493b261e66aa83a3495b2a1532f02a63de26:922c64590222798bb761d5b6d8e72950