id: mongodb-unauth

info:
  name: MongoDB - Unauthenticated Access
  author: pdteam,ashvinctrl
  severity: high
  description: MongoDB was able to be accessed with no password. Note that MongoDB does not require a password by default.
  remediation: Enable Authentication in MongoDB
  reference:
    - https://github.com/orleven/Tentacle
    - https://book.hacktricks.wiki/en/network-services-pentesting/27017-27018-mongodb.html
    - https://www.mongodb.com/features/mongodb-authentication
  metadata:
    max-request: 1
  tags: network,mongodb,unauth,misconfig,tcp,vuln

tcp:
  - inputs:
      - data: 450000000100000000000000dd070000000000000030000000026765744c6f670010000000737461727475705761726e696e67730002246462000600000061646d696e0000
        type: hex

    host:
      - "{{Hostname}}"
    port: 27017

    read-size: 2048
    matchers:
      - type: word
        words:
          - "totalLinesWritten"
# digest: 4b0a004830460221009d6b757d4144d3309dc45c299c2d02287479fa56a3ed9957887cab9efdceb7c5022100c3e5ef2f1c596b6270bbab364dbd27981b152c2bcecd575f3ec5089c69b8ed42:922c64590222798bb761d5b6d8e72950