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: 4a0a004730450220493c225449880334ce2d56f519afb79f5166a4cb28478d2fc9b14e34eb38a9a40221009dfb512c5b73b64229a892cee255a3273c91f822da2f79852ec068f5c468eb0a:922c64590222798bb761d5b6d8e72950