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

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: 490a0046304402201f8253659b7057acbe84d9ecbc607570529855979aafa9952ed3f38c863a691b0220746b8763cbb7d96dad3c2176d098e9003d90f689bad8bb74ea24983a13340de3:922c64590222798bb761d5b6d8e72950