id: torchserve-detect

info:
  name: TorchServe API Description - Detect
  author: DhiyaneshDk
  severity: info
  description: |
    Detects the presence of TorchServe APIs.
  metadata:
    verified: true
    max-request: 1
    vendor: pytorch
    product: torchserve
    fofa-query: body="Requested method is not allowed, please refer to API document"
  tags: tech,pytorch,api,discovery

http:
  - method: GET
    path:
      - "{{BaseURL}}/api-description"

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - 'TorchServe APIs"'
          - '"apiDescription"'
          - 'operationId":'
        condition: or

      - type: word
        part: content_type
        words:
          - "application/json"
# digest: 490a0046304402204b9c790eaae0812f804ec6fb372df739d9201f9f4a1c248cfc6077715bf9a11d0220056a6825c9708696d99aa82c7a039d8d12b4e58ee8ded008895cb2a6afdba6e7:922c64590222798bb761d5b6d8e72950