id: cgit-detect

info:
  name: cgit Web Interface - Detection
  author: ritikchaddha
  severity: info
  description: |
    Detects cgit web interface for Git repositories. cgit is a hyperfast web frontend for Git repositories written in C. It provides a web-based interface to browse Git repositories, view commits, diffs, and files. cgit is designed to be publicly accessible for open source projects. However, detecting cgit instances
  reference:
    - https://git.zx2c4.com/cgit/about/
    - https://wiki.archlinux.org/title/Cgit
  metadata:
    max-request: 1
    verified: true
    product: cgit
    vendor: zx2c4
    shodan-query: http.html:"cgit"
    fofa-query: body="cgit"
    google-query: intext:"generated by cgit"
  tags: tech,cgit,git,panel,detect

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

    redirects: true

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "cgit"
          - "generated by"
        condition: and

      - type: word
        part: body
        words:
          - "repository list"
          - "class='list nowrap'"
          - "id='cgit'"
          - "cgit.css"
        condition: or

      - type: status
        status:
          - 200
# digest: 490a0046304402205a62b7191761018edeb3c3249802f69c8af4a3b446ee3530c6f2e219e241001c022023a7da37c769eaf33e5ee4a78c6ad8cca8b03ff008a0ba68d34a46a9ebee9f00:922c64590222798bb761d5b6d8e72950