id: jan-detect

info:
  name: Jan AI - Detect
  author: insidetrust,hdm
  severity: info
  description: |
    Detects the Jan AI local server, an open-source ChatGPT alternative that runs models locally and exposes a Cortex-powered, OpenAI-compatible API (default port 1337).
  reference:
    - https://github.com/janhq/jan
    - https://jan.ai/docs/server
  metadata:
    verified: false
    max-request: 2
    vendor: janhq
    product: jan
    shodan-query: 'port:1337 http.title:"Jan"'
    fofa-query: 'body="cortex"'
  tags: tech,detect,jan,llm

http:
  - method: GET
    path:
      - "{{BaseURL}}/v1/models"
      - "{{BaseURL}}/healthz"

    stop-at-first-match: true
    matchers:
      - type: dsl
        dsl:
          - 'contains_all(body, "\"object\":\"list\"", "\"object\":\"model\"") || contains(tolower(body), "ok")'
          - 'contains(content_type, "application/json")'
          - 'status_code == 200'
        condition: and
# digest: 4a0a0047304502210094e740bb6a69e85460270ec8c38e43ffd52620a1415de6f7f6131694908759560220071a0059fb5aa98b545cd678d27cf3732873368e952f8d93769b129a2aebca27:922c64590222798bb761d5b6d8e72950