id: leantime-detect

info:
  name: Leantime - Detect
  author: icarot
  severity: info
  description: |
    Detects a Leantime server, a project management system for non-project managers.
  reference:
    - https://github.com/Leantime/leantime
  classification:
    cpe: cpe:2.3:a:leantime:leantime:*:*:*:*:*:*:*:*
  metadata:
    vendor: leantime
    product: leantime
    shodan-query: title:"Leantime"
  tags: tech,leantime,detect

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

    matchers-condition: and
    matchers:
      - type: word
        words:
          - 'content="Leantime'
          - 'name="leantime-version'
          - 'window.leantime.currentProject'
          - '.leantimeLogo {'
          - 'class="leantimeLogo'
        condition: or

      - type: status
        status:
          - 200

    extractors:
      - type: regex
        name: version
        group: 1
        regex:
          - '<meta name="leantime-version" content="(?<leantime_version>\d+\.\d+\.\d+)">'
# digest: 4b0a00483046022100bb7617403da436b75a379bf518ba0e251a44f0e011d7ffe1113a1fcba8cb1705022100ed0d3dec8868fea540049fcad110b884e596bfc8aea4743a0e1b5d43e5cd80dc:922c64590222798bb761d5b6d8e72950