I just got hacked database and deleted data. see photo

biew55

Verified User
Joined
Sep 22, 2016
Messages
6
Hi all.,

I want to discuss to anyone who have experience about this.

my customer got database gone. by hacker big database around 100g

absolutely hacker need bitcoin from me, see photo

How to protect ?
 

Attachments

  • 2020-03-03_0-40-12-1.png
    2020-03-03_0-40-12-1.png
    56.5 KB · Views: 178
  • 2020-03-03_0-24-24.png
    2020-03-03_0-24-24.png
    99.9 KB · Views: 167
I've seen this reported by multiple customers, who had very easy root password for MySQL set (or no password at all).
 
I've seen this reported by multiple customers, who had very easy root password for MySQL set (or no password at all).
What is the default installation modus by DA then ? is it installed by default with password ? I'm curios now
 
What is the default installation modus by DA then ? is it installed by default with password ? I'm curios now
Yes, it's installed with a random password by default, stored in /usr/local/directadmin/conf/my.cnf.
 
Even better, with 2 passwords by default.
The one mentioned by smtalk is the da_admin user password (also has root rights).
There's also a mysql root password which can be found at /usr/local/directadmin/scripts/setup.txt but this is normally not used. Might come in handy though if you ever change your mysql da_admin pass and forget it. Easy way to change it back via root.
 
I thought there's no root credentials for mysql installs, or if there are, it's removed after installation in favour of DA's details.... Am I mistaken?
 
Wow.... please take care. I think .... it can only deleted. cant get the files
 

Attachments

  • 2020-03-03_10-32-13.png
    2020-03-03_10-32-13.png
    212.1 KB · Views: 121
  • 2020-03-03_10-34-11.png
    2020-03-03_10-34-11.png
    141.8 KB · Views: 113
I thought there's no root credentials for mysql installs, or if there are, it's removed after installation in favour of DA's details.... Am I mistaken?
Yes you are mistaken. You can check for yourself, they are in the file I mentioned.
 
Wow.... please take care. I think .... it can only deleted. cant get the files
You sure? You can't login to mysql via console and do a list? Tried with both da_admin and root accounts?
Files aer in /var/lib/mysql and all accounts are in there too, maybe you can backup them or something. I'm not a mysql guru though, so I can't help you any further.
 
Got also a report from one of my customers a day ago. These kind of attacks are usually done on servers with port TCP 3306 opened world-wide. So this is a very bad idea to get 3306 port publicly opened with MySQL bind to it.

Another question: probably anybody tried to decrypt hacked data in MySQL/MariaDB ?
 
No way to say it for 100%, I guess. Critical data might be stolen.... of course. But what to do if an user does not have backups? To pay a hacker?

Visually check MySQL tables where users/passwords are stored, erase and reinstall Mysql database and re-create all necessary users....other.
 
@zEitEr and @biew55, would you mind share if the hacked database was running on MySQL or MariaDB, and also what version of those? Also, was they running with a strong password?

Edit: And did the hacker get root access to MySQL/MariaDB? If not, it could just be a compromised WordPress install, and then the hacker could find the password to the database in wp-config.php. WordPress is just a example because it is widely used, but it could be any other CMS also. If that is the case, I find nothing special to it - if a CMS is compromised, I would also assume the database could be compromised - and that happens all the time.
 
Last edited:
@ditto

Well as far as I can say, they hacked exactly 3306 port. I've seen hacked servers with and without DirectAdmin, in all cases 3306 port has been publicly opened. Mostly MariaDB, but I won't say there were no MySQL instances.

They either removed existing tables or encrypted them, and created a WARNING table

Code:
/var/lib/mysql/user_db/WARNING.frm
/var/lib/mysql/user_db/WARNING.ibd

with the following content:

To recover your lost Database and avoid leaking it: Send us 0.06 Bitcoin (BTC) to our Bitcoin address 1BLYhU********cTWgc6gFT6DCYwbVieUD and contact us by Email with your Server IP or Domain name and a Proof of Payment. If you are unsure if we have your data, contact us and we will send you a proof. Your Database is downloaded and backed up on our servers. If we dont receive your payment in the next 10 Days, we will make your database public or use them otherwise.

I've masked the Bitcoin address.

In certain cases we could see files like:

Code:
 /var/lib/mysql/mysql/\usr\lib64\mysql\plugin\\cna12.dll.

with various names under /var/lib/mysql/, they probably utilized LOAD DATA statements to gain a privileged access to a server.
 
Thank you for the information. But you don't say anything about what version of MariaDB they was running? Was it the latest version? I am just trying to figure out if this is some new vulnerability that we do not yet know of, or if it is only because of sysadmins that have not done their job at upgrading.

It would also be of interest to know if their MariaDB/MySQL root password was strong or not? And also if they had local-infile=0 in /etc/my.cnf or not?

Generally I do not think it should be needed to close port 3306 in the firewall, also some customers sometimes want to open up for a remote IP to connect to their database (they can do that in user level in DirectAdmin), but that would not work if we close down port 3306 in the firewall.
 
We did not put our hands on solving the recent incident. The user had no backups to recover from. So I can't say what version is used there.

The older cases happened to MariaDB 10.3. My records indicate:

Code:
2019-08-03 09:08:10 : mariadb 10.3.17 installed
2019-09-22 07:09:37 : mariadb 10.3.18 installed
2019-11-17 07:11:01 localhost: mariadb 10.3.20 installed
 
Thank you. When looking at MariaDB changelogs, there is no CVE fixes in MariaDB 10.3.21, and in MariaDB 10.3.22 there is only one CVE (CVE-2020-2574), but by the description of it, it does not seem that could be the cause: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2574

On a 4 month old DirectAdmin install, I see that the default passwords in /usr/local/directadmin/scripts/setup.txt of mysql= is 17 characters and adminpass= is 14 characters. That should be strong enough.

However the default user da_admin password in /usr/local/directadmin/conf/mysql.conf is only 10 characters long. That is to short for my liking. I sugest DirectAdmin change the default to be minimum 14 characters.
 
User create : da_admin

Is da_admin and root mysql same or different?

They're likely the same.

Well as far as I can say, they hacked exactly 3306 port. I've seen hacked servers with and without DirectAdmin, in all cases 3306 port has been publicly opened. Mostly MariaDB, but I won't say there were no MySQL instances.

There shouldn't be any root@% users by default, so, even if 3306 is open, it shouldn't let anyone to connect to localhost accounts.
 
Back
Top