I was browsing mysql-slow-logs to check for potentiall optimization and I've noticed weird schema in them ( see below ):
SELECT password, type FROM accounts AS a JOIN sys_users AS s ON (a.id = s.account_id) WHERE s.login='**DICTIONARY_USER_NAME_HERE**' AND (SELECT count(*) FROM hosting AS h WHERE h.sys_user_id = s.id) = 0 AND (SELECT count(*) FROM web_users AS w WHERE w.sys_user_id = s.id) = 0 AND (SELECT count(*) FROM ftp_users AS f WHERE f.sys_user_id = s.id) = 0;
What's more frightening is that those queries are executed from admin@localhost ( which is specified Plesk MySQL user )
I've check in and it seems that Plesk stores some of passwords in plain text and those queries are obvious dictionary method to guess the login so mysql would respond with plain text password
So to sum up
- queries called as admin@localhost
- plesks passwords in plain text
I'm not sure what is the vector of attack but if we take few things in consideration:
- the attacker does not now admin's password, else he could perform exact query instead of dictionary
- the attacker obviously is not going through ssh / remote mysql execution
- its probably the plesk's fault as I observed it on both servers which run under different OS, different configuration and only one of it has any content ( website/app or whatever which could be a possible vector of attack )
- the most probable seems to be that the attacker ( or bot in this case ) is executing a query via some of Plesk's not secured scripts ( those who allows such query while not requiring you to be logged in )
Now I may totally wrong and missuderstood the situation and it's some kind of totally normal Plesk action ( which I doubt ) what's also weird is that I could not find anything in Google about this vulnerability
Some tech/soft background:
- VPS
- 1xCentOS 5 / 1xDebian ( both x64 )
- Plesk Panel v. 10.4.4
I would be very greatfull if someone could confirm that they did encounter that problem/attack and maybe some kind of solutions how to prevent attacker - he eventually might guess the login, he didn't got it yet.
Upgrading to v. 11 is for now out of discussion - VPS provider said he cannot do that yet, I cannot move projects to other VPS or at least not so fast
Thanks in advance & Regards, Adam