id: gitea-detect

info:
  name: Gitea Detect
  author: pikpikcu,righettod
  severity: info
  description: Gitea was detected.
  reference:
    - https://about.gitea.com/
    - https://docs.gitea.com/api
  metadata:
    verified: true
    max-request: 1
    shodan-query: http.title:"Gitea"
  tags: tech,gitea,discovery

http:
  - method: GET
    path:
      - "{{BaseURL}}/user/login"

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "Powered by Gitea"
          - 'content="Gitea'
        condition: or

      - type: status
        status:
          - 200

    extractors:
      - type: regex
        part: body
        group: 1
        regex:
          - "Powered by Gitea(\\s*)Version:(\\s*)([\\d.]+)"
          - "Gitea Version: ([0-9a-z+-.~]+)"
          - 'theme-gitea-auto.css\?v=([0-9a-z+-.~]+)'
          - 'encodeURIComponent.{2}([0-9a-z+-.~]+).{2}'
# digest: 4a0a0047304502207026459b4e6c1bfb62c44df373e1860576d487b0ce21a37a1a72139d9aaf15a0022100e66dbbb78da8f2de070462027351e279242822585e4073bef6e9a51f5b768de0:922c64590222798bb761d5b6d8e72950