id: cobbler-version

info:
  name: Cobbler Version Detection
  author: c-sh0
  severity: info
  description: Obtain cobbler version information
  metadata:
    max-request: 1
  tags: tech,cobbler,api,discovery

http:
  - method: POST
    path:
      - "{{BaseURL}}/cobbler_api"

    body: |
      <?xml version='1.0'?>
      <methodCall>
      <methodName>extended_version</methodName>
      <params></params>
      </methodCall>

    headers:
      Content-Type: text/xml

    matchers-condition: and
    matchers:
      - type: status
        status:
          - 200

      - type: word
        part: body
        words:
          - '<name>version</name>'

    extractors:
      - type: regex
        part: body
        group: 1
        regex:
          - "<value><string>([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})</string></value>"
# digest: 4a0a0047304502203c2d8904727d0a36ff3b30e0c30573e9736d6bdedf09a9af8090a3ccbda5776a022100c263a314290e8d8c850c20a64b28b1d366fd16bab532d41a9dc092db21c2e951:922c64590222798bb761d5b6d8e72950