id: discord-token

info:
  name: Discord API Token
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/returntocorp/semgrep-rules/blob/develop/generic/secrets/gitleaks/discord-api-token.yaml
    - https://github.com/returntocorp/semgrep-rules/blob/develop/generic/secrets/gitleaks/discord-api-token.go
  metadata:
    verified: true
    max-request: 1
  tags: discord,exposure,tokens

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

    extractors:
      - type: regex
        part: body
        regex:
          - (?i)(?:discord)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{64})(?:['|\"|\n|\r|\s|\x60|;]|$)
# digest: 4b0a00483046022100d89389701308a7a74fffcee8d7de38a503e9461f401f1debdc75d26b32ef902a0221009b3b1c2056301c38272e6229b5eba085e697c7033d4eb79a9aef8a247da6db95:922c64590222798bb761d5b6d8e72950