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