Data Security Insights
Are Your Databases Securely Locked Down?
In this write-up, I share my experience investigating public database exposures. By using publicly available tools and techniques, I discovered open-access SQL and MongoDB databases belonging to local companies—exposing sensitive data without proper protection. Let’s walk through the process and how organizations can better protect themselves.
Most administrators assume that database access is limited to internal systems. However, many servers are accidentally exposed to the public internet—without passwords or encryption. Tools like Shodan make it shockingly easy to find them.
For instance, misconfigured MongoDB instances often expose full collections, while outdated SQL databases may allow remote connections without credentials.
Shodan.io indexes services running on public IPs. By crafting the right search queries, I located dozens of unsecured databases in my city.
product:"MongoDB" port:"27017" country:"TN" city:"Sfax"
Using queries like the one above, I found numerous targets. Some even allowed read/write access without authentication.
Once IPs were collected, I used basic scripts and tools such as mongo shell or mysql-client to test access. Here's how simple it was to connect:
# MongoDB mongo --host--port 27017 # MySQL mysql -h -P 3306 -u root
In many cases, no authentication was required. This is a critical oversight by admins unaware that their databases are public-facing.
While many were open, some databases did require credentials. I used tools like Hydra to attempt common username-password combinations.
hydra -L users.txt -P passwords.txt mongodb://:27017/
To ensure your databases are protected, consider implementing the following best practices:
Disclaimer:
This tutorial is for educational and awareness purposes only. Do not attempt unauthorized access on any systems you do not own or manage.
Cybersecurity begins with awareness. Stay safe, stay informed.