id: sglang-detect

info:
  name: SGLang - Detect
  author: insidetrust,hdm
  severity: info
  description: |
    Detects SGLang, a high-performance LLM serving framework that provides an OpenAI-compatible API (default port 30000). This template identifies SGLang by checking for the unique /get_model_info endpoint (returning "model_path" and "is_generation") and Prometheus metrics prefixed with "sglang:". An unauthenticated server exposes inference access and reveals the underlying model path, which is extracted if found.
  reference:
    - https://github.com/sgl-project/sglang
    - https://docs.sglang.ai/backend/openai_api_completions.html
  metadata:
    verified: true
    max-request: 2
    vendor: sgl-project
    product: sglang
    shodan-query: http.html:"is_generation"
  tags: tech,detect,sglang,llm

http:
  - method: GET
    path:
      - "{{BaseURL}}/get_model_info"
      - "{{BaseURL}}/metrics"

    stop-at-first-match: true
    matchers-condition: or
    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains_all(body, "\"model_path\"", "\"is_generation\"") || contains(body, "sglang")'
        condition: and
# digest: 4b0a00483046022100a4117844c376929774e97869ea0fab05239e99ed02194d1a78822f93eafa4c3a022100ba69b483b1d7153d9cea0f811abb347508e552205ed3e656592c585c9e1c4fea:922c64590222798bb761d5b6d8e72950