id: squarespace-detect

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

http:
  - method: GET
    path:
      - "{{BaseURL}}"
      - "{{BaseURL}}/robots.txt"
      - "{{BaseURL}}/sitemap.xml"
      - "{{BaseURL}}/favicon.ico"
      - "{{BaseURL}}/_static/"
      - "{{BaseURL}}/squarespace.js"
      - "{{BaseURL}}/config.json"
      - "{{BaseURL}}/media-cache"

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

      - type: status
        status:
          - 200
          - 403

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

      - type: regex
        part: body
        name: squarespace_id
        regex:
          - 'squarespace-site-id=([a-z0-9]+)'
          - 'siteid="([a-zA-Z0-9]+)"'
          - 'squarespace\.com/([^/]+)'
# digest: 490a00463044022062322ace2550a2b9ded4c465efcbbf77447e3ac1acb0d6dba8841ee5e47084c802204ab70d9b647afa3438cfb8a39ee80bd8d50647d3117e636f869f8dad98f5807c:922c64590222798bb761d5b6d8e72950