id: sap-listconfigfiles-disclosure

info:
  name: SAPControl ListConfigFiles - Disclosure
  author: LRVT,l4rm4nd
  severity: medium
  description: |
    Detected SAP systems where the SAP Start Service (sapstartsrv) SAPControl SOAP interface exposes the ListConfigFiles web method without authentication.
  reference:
    - https://itsiti.com/csmon/
    - https://cloud.ibm.com/docs/sap?topic=sap-monitoring-prereqs
    - https://help.sap.com/docs/SUPPORT_CONTENT/si/3362959700.html
  metadata:
    max-request: 1
  tags: misconfig,sap,sapcontrol,soap,config,disclosure

http:
  - raw:
      - |
        POST / HTTP/1.1
        Host: {{Hostname}}
        Content-Type: text/xml; charset=UTF-8
        SOAPAction: '""'

        <?xml version="1.0" encoding="utf-8"?>
        <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
          <SOAP-ENV:Header>
            <sapsess:Session xmlns:sapsess="http://www.sap.com/webas/630/soap/features/session/">
              <enableSession>true</enableSession>
            </sapsess:Session>
          </SOAP-ENV:Header>
          <SOAP-ENV:Body>
            <ns1:ListConfigFiles xmlns:ns1="urn:SAPControl"/>
          </SOAP-ENV:Body>
        </SOAP-ENV:Envelope>

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "ListConfigFilesResponse"
          - "<configfiles>"
        condition: and

      - type: status
        status:
          - 200
# digest: 490a0046304402206d3a5fb3c18039f2fce19e2b0e5743f34a0c3570a4bd64a3da05f456bcc2fea502205b7eef22b7f753b862c2e55186572cd04e006347d65d1a0d456c5ac6c0511d6d:922c64590222798bb761d5b6d8e72950