id: mongodb-info-enum

info:
  name: MongoDB Information - Detect
  author: pussycat0x,h4sh5
  severity: info
  description: |
    MongoDB build and server information was detected.
  reference:
    - https://nmap.org/nsedoc/scripts/mongodb-info.html
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
    cwe-id: CWE-200
  metadata:
    verified: true
    max-request: 1
    shodan-query: mongodb server information
  tags: network,mongodb,enum,tcp,discovery

tcp:
  - inputs:
      - data: 3b0000003c300000ffffffffd40700000000000061646d696e2e24636d640000000000ffffffff14000000106275696c64696e666f000100000000
        type: hex

    host:
      - "{{Hostname}}"
    port: 27017
    read-size: 2048

    matchers:
      - type: word
        part: raw
        words:
          - "version"
          - "maxBsonObjectSize"
        condition: and

    extractors:
      - type: regex
        group: 1
        regex:
          - "version.....([0-9.]+)"
# digest: 490a0046304402202eece2c65d9151df79262baaa1d0beb66308265283ff7937d959aae2cf4c0fbc022008e76f29e5fdaf104fb9059c2c118919ccd48de1bce9d8e25a751c03c85dd184:922c64590222798bb761d5b6d8e72950