id: shopify-detect

info:
  name: Shopify Detection
  author: Chirag Mistry
  severity: info
  description: |
    An instance running Shopify is detected by looking for specific HTTP headers, HTML tags, and known endpoints.
  metadata:
    max-request: 7
    shodan-query: http.component:"Shopify"
  tags: shopify,detect,tech

http:
  - method: GET
    path:
      - "{{BaseURL}}"
      - "{{BaseURL}}/robots.txt"
      - "{{BaseURL}}/sitemap.xml"
      - "{{BaseURL}}/admin"
      - "{{BaseURL}}/shopify_app"
      - "{{BaseURL}}/shopify_api"
      - "{{BaseURL}}/favicon.ico"

    stop-at-first-match: true
    matchers-condition: and
    matchers:
      - type: word
        part: response
        words:
          - "X-Shopify-Stage"
          - "Powered by Shopify"
          - "cdn.shopify.com"
          - "Shopify Store"
          - "Shopify Liquid"
        condition: or
        case-insensitive: true

      - type: status
        status:
          - 200
          - 403

    extractors:
      - type: regex
        part: body
        name: version
        regex:
          - 'Shopify ([0-9.]+)'
          - 'Shopify version ([0-9.]+)'
          - 'Coded by Shopify ([0-9.]+)'
          - 'Theme: ([A-Za-z0-9_-]+) Shopify'

      - type: regex
        part: body
        name: shopify_id
        regex:
          - 'shop_id=([0-9]+)'
          - 'shopify://([0-9a-zA-Z]+)'
# digest: 490a004630440220326acd1c15c0caf10a2c60882eccd70e0d671de3218b9cf0a07c1e936435176d022038817078e62b8859b6ae56bf806a3c7f388485b9402dad5ba7070098891a1821:922c64590222798bb761d5b6d8e72950