id: twitter-api-secret

info:
  name: Twitter API Secret Token
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/semgrep/semgrep-rules/blob/develop/generic/secrets/gitleaks/twitter-api-secret.go
    - https://github.com/semgrep/semgrep-rules/blob/develop/generic/secrets/gitleaks/twitter-api-secret.yaml
    - https://developer.twitter.com/en/docs/authentication/overview
  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-z0-9]{50})(?:['|\"|\n|\r|\s|\x60|;]|$)
# digest: 4a0a0047304502210096118a6d10bd25e45a93d2252b42c99a9b2b543f842eb25eb4843392d7150d9002206f79b8e7959f97fb8f702f403b8e2ca2b3e0d62e591549ff07bd91b418160174:922c64590222798bb761d5b6d8e72950