id: bitrix-detect

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

http:
  - method: GET
    path:
      - "{{BaseURL}}"
      - "{{BaseURL}}/robots.txt"
      - "{{BaseURL}}/sitemap.xml"
      - "{{BaseURL}}/favicon.ico"
      - "{{BaseURL}}/bitrix/js/main/core/core_min.js"
      - "{{BaseURL}}/bitrix/admin/"
      - "{{BaseURL}}/bitrix/templates/"
      - "{{BaseURL}}/bitrix/panel/"

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

      - type: status
        status:
          - 200

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

      - type: regex
        part: body
        name: bitrix_id
        regex:
          - 'bitrix-site-id=([a-z0-9]+)'
          - 'bitrix\.com/([^/]+)'
# digest: 4a0a0047304502210081201b19ca1603329039c44fabb19308aabb324c5e0e2eb87b64e7e16b6df3b40220191531a7e138362b781f6a361d43d2381b21f4a5e8ebd29f826bb2c4cad0c7bf:922c64590222798bb761d5b6d8e72950