id: oqtane-cms-db

info:
  name: Oqtane CMS Database - Detect
  author: Masoud Abdaal
  severity: info
  description: Detect which database distribution the target oqtane cms use.
  reference:
    - https://github.com/oqtane/oqtane.framework?tab=readme-ov-file#oqtane-framework
    - https://github.com/oqtane/oqtane.framework/blob/62879c3e522772830fb19c7c9af569bd6a7c2f78/Oqtane.Server/Controllers/DatabaseController.cs#L23
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
    cwe-id: CWE-200
  metadata:
    verified: true
    max-request: 1
    product: oqtane
    vendor: oqtane
    shodan-query: http.title:'Home - Default Site'
    fofa-query: title="Home - Default Site"
  tags: detect,tech,api,cms,discovery

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

    redirects: true
    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - 'controlType"'
          - 'Oqtane'
          - 'dbType"'
        condition: and

      - type: word
        part: content_type
        words:
          - 'application/json'

      - type: status
        status:
          - 200

    extractors:
      - type: json
        name: default_database
        part: body
        json:
          - '.[] | select(.isDefault == true) | .name'
# digest: 4a0a00473045022100bda50b9209a9589e3b255fb75482f92e5393b023682e167fbdf11f6cf836ecf802204772791e645c3d7861b61339c97cf0ca48b20a25ab70d8b90b63d76802bf05e1:922c64590222798bb761d5b6d8e72950