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,vuln

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