TCP 27017: MongoDB

MongoDB is a source-available cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. MongoDB is developed by MongoDB Inc. and licensed under the Server Side Public License.

-- Wikipedia

Terms

  • Collections are like tables

  • Documents are like rows

  • Fields are like columns

Common operators

  • $eq

  • $ne

  • $gt

  • $where

  • $exists

  • $regex

Basic commands

Show databases

Select database

Create database

Create collection

Show collections

Create document

Query collection

Update document

Delete document

NoSQL injection

Via JSON

Use e.g. { "$ne": "whatever" } as password to bypass login logic.

Via requests

Inject $ne in GET param ?username[$ne]=name to invert the logic.

Last updated