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: 490a004630440220767b3487ac3a3aaa144e80b13e7f29b8bfc9e531770718e6379056761b325ce7022030e87287fbf3716e741e360fe9753a4f362d88b0eaf020f1473abb38d666c162:922c64590222798bb761d5b6d8e72950