id: gitea-login-check

info:
  name: gitea.com Login Check
  author: parthmalhotra,pdresearch
  severity: critical
  description: Checks for a valid gitea account.
  reference:
    - https://owasp.org/www-community/attacks/Credential_stuffing
  metadata:
    max-request: 1
  tags: cloud,creds-stuffing,login-check,gitea

self-contained: true

http:
  - raw:
      - |
        POST https://gitea.com/user/login HTTP/1.1
        Host: gitea.com
        Content-Type: application/x-www-form-urlencoded

        user_name={{username}}&password={{password}}

    extractors:
      - type: dsl
        dsl:
          - username
          - password

    matchers-condition: and
    matchers:
      - type: word
        part: header
        words:
          - 'Location: /'

      - type: status
        status:
          - 303
# digest: 4b0a00483046022100b787ab9f463a8139c9dbab633cf200dcd57eb14f1fe06d123cce3b311fa1f3d3022100c9c819ab99ac6135455c7ff6a1ffb9dab890fe014fa90642e4cc4e829b44751d:922c64590222798bb761d5b6d8e72950