id: shopify-takeover

info:
  name: shopify takeover detection
  author: pdteam,philippedelteil,Imjust0
  severity: high
  description: shopify takeover was detected.
  reference:
    - https://medium.com/@thebuckhacker/how-to-do-55-000-subdomain-takeover-in-a-blink-of-an-eye-a94954c3fc75
    - https://github.com/EdOverflow/can-i-take-over-xyz/issues/32
    - https://github.com/EdOverflow/can-i-take-over-xyz/issues/46
    - https://hackerone.com/reports/1711890
  metadata:
    max-request: 1
  tags: takeover,hackerone

http:
  - method: GET
    path:
      - "{{BaseURL}}"

    matchers-condition: and
    matchers:
      - type: dsl
        dsl:
          - Host != ip

      - type: word
        words:
          - 'To finish setting up your new web address, go to your domain settings, click "Connect existing domain"'
          - "Sorry, this shop is currently unavailable."
          - "Sorry, this store is currently unavailable."
        condition: or

      - type: word
        words:
          - 'shop-not-found'

      - type: dsl
        dsl:
          - '!contains(host,"myshopify.com")'
          - '!contains(host,"shopify.com")'
        condition: and

    extractors:
      - type: dsl
        dsl:
          - cname
# digest: 4a0a0047304502210080de10bc6b082036af6209a9225eaeb477346ee902cbfd15fd71f1401022795202203b01ab3fb4526264ee2460414a29825e568662b01369b5f60d5637aad41b9d5b:922c64590222798bb761d5b6d8e72950