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