id: harbor-panel

info:
  name: Harbor Login Panel - Detect
  author: daffainfo,righettod
  severity: info
  description: Harbor login panel was detected.
  reference:
    - https://github.com/goharbor/harbor
  classification:
    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
    cwe-id: CWE-200
    cpe: cpe:2.3:a:linuxfoundation:harbor:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 4
    vendor: linuxfoundation
    product: harbor
    shodan-query: http.favicon.hash:657337228
    fofa-query: icon_hash=657337228
  tags: panel,harbor,linuxfoundation,detect,login

http:
  - method: GET
    path:
      - '{{BaseURL}}/api/v2.0/systeminfo'
      - '{{BaseURL}}/api/systeminfo'
      - '{{BaseURL}}/account/sign-in'
      - '{{BaseURL}}/harbor/sign-in'

    stop-at-first-match: true
    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains_any(to_lower(body), "<title>harbor</title>", "<harbor-app>", "harbor_version")'
        condition: and

    extractors:
      - type: regex
        part: body
        group: 1
        regex:
          - '(?i)"harbor_version":\s*"([a-z0-9.\-]+)"'
# digest: 490a00463044022004543c34bcca27d75657e216b78ffa48b21b050da2495c329e9cb5a4de9b6c6c0220193cc2790dd4ce7f60fefb5a574dcbb48f1a418c8c0ddb62db9cd7d4195d310c:922c64590222798bb761d5b6d8e72950