How did my database got hacked ?

May 30, 2019 330 views
Databases Security Ubuntu 18.04

I’m developing a multiplayer game in my free time and when I connected to my droplet today I figured out that my database was just hacked:

Altough I havn’t set specific securities, my root user has a 9 chars alphanumerical password, is it possible that it got bruteforced ? Ubuntu hasn’t a bruteforce protection ?

Thanks :)

1 Answer

It was most-likely an SQL injection. You could try checking your access logs for some odd looking POST requests. Also always make sure to sanitize your queries.

  • I think I found what was going on, although the server OS was secured with a strong password, the postgress database was not, I forgot to change the default password and I guess a bot just scanned my db and tried the default password ! I’m dumb x)

    It can’t be SQL injection as the client never really commands the database, that is to say that the client sends packets then the server processes these packets and asks the database but no SQL injection is possible as the information in the packet is already “parsed” by the server logic, no raw data is queried.

Have another answer? Share your knowledge.