id: bigcommerce-detect

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

http:
  - method: GET
    path:
      - "{{BaseURL}}"
      - "{{BaseURL}}/robots.txt"
      - "{{BaseURL}}/sitemap.xml"
      - "{{BaseURL}}/favicon.ico"
      - "{{BaseURL}}/bigcommerce.js"
      - "{{BaseURL}}/stores"
      - "{{BaseURL}}/cart"
      - "{{BaseURL}}/admin"

    stop-at-first-match: true
    matchers-condition: and
    matchers:
      - type: word
        part: response
        words:
          - "Powered by BigCommerce"
          - "X-BigCommerce-Request-Id"
          - "bigcommerce.com"
        condition: or
        case-insensitive: true

      - type: status
        status:
          - 200

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

      - type: regex
        part: body
        name: bigcommerce_id
        regex:
          - 'bigcommerce-site-id=([a-z0-9]+)'
          - 'bc-site-id="([a-zA-Z0-9]+)"'
          - 'bigcommerce\.com/([^/]+)'
# digest: 4b0a00483046022100e54b03a849920d251bacc0a9be3fe102d1164021045e662dc7cb68f1be598186022100863bb67aee8056b0f639dea353861e80fb87218611b1c7f965a5cc1b74a75f79:922c64590222798bb761d5b6d8e72950