Connecting
mongo --host mongodb0.example.com --port 28015
or for authentication: mongo --username alice --password --authenticationDatabase admin --host mongodb0.examples.com --port 28015
.
Querying / Exploiting
to show all databases: show dbs
, then use dbname
to select the db you want.
to see all inside the db, use show collections
.
Finally use db.collectionName.find()
(usually db.admin.find()
, or can use mongo --port 27117 dbname --eval "db.admin.find().forEach(printjson);"
)