id: twitter-bearer-token

info:
  name: Twitter Bearer Token
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/semgrep/semgrep-rules/blob/develop/generic/secrets/gitleaks/typeform-api-token.go
    - https://github.com/semgrep/semgrep-rules/blob/develop/generic/secrets/gitleaks/twitter-bearer-token.yaml
  metadata:
    verified: true
    max-request: 1
  tags: twitter,exposure,tokens

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

    extractors:
      - type: regex
        part: body
        regex:
          - (?i)(?:twitter)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}(A{22}[a-zA-Z0-9%]{80,100})(?:['|\"|\n|\r|\s|\x60|;]|$)
# digest: 4b0a00483046022100a94d20f56681c7592c9ab3e1b31cf4d17317f6465c783dc3b67181544e6edc02022100cfb1f32edd03d6731bda026c9991150c59b5fbada2ce2116b583b11b4da04421:922c64590222798bb761d5b6d8e72950