ID: I202512301655
Status: idea
Tags: MongoDB, ransome, hacking
My Mongodb ransome hack
I got hacked. Wow.

Recently I found the above item in my MongoDB container. I checked my API logs, and it didnāt get any traffic from there, so it mustāve been to do with the recent MongoBleed exploit.
I had switched mongo versions after the CVE, which you can read in My MongoBleed measures. But apparently that didnāt help. SO either I was too late and the user was already extracted, or there is something else.
But I remembered that I made a Portainer backups script. This includes my MongoDB containers. So all is well. Or at least, kinda. I had to do the following things:
- Extract all my DB exports with
rsync -avz root@<VPS_IP>:/root/backups/mongodb/ ~/vps-backups/mongodb/ - Restoring
mongo_2025-12-26_14-00.archiveon the same db - Killing the
v7.0.28container - Creating a
8.2.3-noblecontainer - Creating a new admin user
- Creating a mongodb user for apps
- Importing the Export into the new db
- Renaming the DB from
testto something else (yes I made that mistake when starting out) - Changing the export cron job to use the new credentials, here is the cron job.sh
- Changing all apps to use new credentials
- Changing passwords because you find out that you have special characters in your password, and mongo dislikes those.
- Changing all passwords in the database, and of people with permissions