id: lemlist-takeover

info:
  name: Lemlist - Subdomain Takeover Detection
  author: kresec
  severity: high
  description: |
    The takeover will succeed when the target domain has a cname that points to the lemlist and in their account they only customize the domain in the tracking column so in the custom page column, as an attacker, they can enter the target domain.
  reference:
    - https://www.lemlist.com/blog/custom-tracking-domain
    - https://kresec.medium.com/10k-site-affected-subdomain-takeover-via-lemlist-146cd0f11883
  metadata:
    max-request: 1
  tags: dns,takeover,lemlist

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

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

      - type: word
        words:
          - "Custom domain check"
          - "app.lemlist.com"
        condition: and

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