id: datadog-login-check

info:
  name: Datadog Login Check
  author: parthmalhotra,pdresearch
  severity: critical
  description: Checks for a valid datadog account.
  reference:
    - https://owasp.org/www-community/attacks/Credential_stuffing
  metadata:
    max-request: 2
  tags: cloud,creds-stuffing,login-check,datadog,vuln

self-contained: true

http:
  - raw:
      - |
        GET https://app.datadoghq.com/account/login HTTP/1.1
        Host: app.datadoghq.com
      - |
        POST https://app.datadoghq.com/account/login? HTTP/1.1
        Host: app.datadoghq.com
        Content-Type: application/x-www-form-urlencoded

        _authentication_token={{auth_token}}&username={{username}}&password={{password}}

    extractors:
      - type: regex
        name: auth_token
        part: body
        internal: true
        group: 1
        regex:
          - "authentication_token&#34;: &#34;(.*?)&#34;,"

      - type: dsl
        dsl:
          - username
          - password
    attack: pitchfork

    matchers-condition: and
    matchers:
      - type: word
        part: header
        words:
          - 'Set-Cookie: dogweb='

      - type: status
        status:
          - 302
# digest: 4a0a0047304502207ffee6dea6b55c536124f12f76644e41caf3f789c5d9e70f3a2f2f5bae61b188022100c5e9fabafbc04710df4818c0958c53733a35df4505d9aa13611f55360074c044:922c64590222798bb761d5b6d8e72950