id: nextcloud-install

info:
  name: Nextcloud Exposed Installation
  author: skeltavik
  severity: high
  description: Nextcloud installation is exposed.
  reference:
    - https://docs.nextcloud.com/server/latest/admin_manual/installation/installation_wizard.html
  metadata:
    max-request: 1
  tags: tech,nextcloud,storage,misconfig

http:
  - method: GET
    path:
      - '{{BaseURL}}'

    host-redirects: true
    max-redirects: 2

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '<fieldset id="adminaccount"><legend>Create an <strong>admin account</strong></legend>'
          - '<legend><a id="showAdvanced" tabindex="0" href="#">Storage &amp; database'
        condition: and

      - type: status
        status:
          - 200
# digest: 4a0a00473045022100ca09cdc825737fa994f6308a1fc183e3847df5af8d07db70d5811c213960ff9002201a68a8f6d49a0dd743c9f7f1bfb9318a95939d5e4239e58f029c7d3f67374ff5:922c64590222798bb761d5b6d8e72950