id: ghost-takeover

info:
  name: ghost takeover detection
  author: pdteam
  severity: high
  description: ghost takeover was detected.
  reference:
    - https://github.com/EdOverflow/can-i-take-over-xyz/issues/89
  metadata:
    max-request: 1
  tags: takeover,ghost,vuln

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

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

      - type: word
        part: header
        words:
          - 'error.ghost.org'
          - 'offline.ghost.org'
        condition: or

      - type: status
        status:
          - 302

    extractors:
      - type: dsl
        dsl:
          - cname
# digest: 490a004630440220329695afc53997db3695bb828fd096788c01356d6de4124531cf44060925bc2602206769f6bc9905088bbafeebe87b8da8bfb4e268c25304f8784c87dbbea0ffbf09:922c64590222798bb761d5b6d8e72950