id: gitbook-takeover

info:
  name: gitbook takeover detection
  author: philippedelteil
  severity: high
  description: gitbook takeover was detected.
  reference:
    - https://github.com/EdOverflow/can-i-take-over-xyz/issues/259
    - https://hackerone.com/reports/223625
  metadata:
    max-request: 1
  tags: takeover,gitbook,hackerone

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

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

      - type: word
        words:
          - "If you need specifics, here's the error"
          - "Domain not found"
        condition: and

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