Finding usernames and passwords in Plesk DB

Need a username and password from the Plesk DB? Use this one-liner:

select REPLACE(sys_users.home,'/home/httpd/vhosts/','') AS domain,sys_users.login,accounts.password from sys_users LEFT JOIN accounts on sys_users.account_id=accounts.id;

One Response

  1. I wanted to say “thanks a bunch” for this site, since it’s been a really useful resource on innumerable occasions, but “thanks a bunch” seemed hoplessly inadequate. So, having used this tip today, I thought I’d extend it just a tiny little bit, by way of a small thankyou gesture.

    Given that I have 300+ domains on any instance of Plesk, using that mysql one liner delivers several screenfuls of data which is a devil of a thing to sort through. SO I thought to myself; “self, write the output to a text file whydoncha?”

    Thus, the one liner becomes this;

    select REPLACE(sys_users.home,’/home/httpd/vhosts/’,”) AS domain,sys_users.login,accounts.password from sys_users LEFT JOIN accounts on sys_users.account_id=accounts.id INTO OUTFILE ‘/tmp/plesk_logins.txt’;

    Somewhere in there, it would be REALLY nice to be able to filter by client login (not pname, just the login from the “client” table) but my sql abilities aren’t up to figuring that chunk out. I think it’s probably enough just to be able to squirt the entire mess into a text file, import that into [insert choice of spreadsheet application here] and take it from there.
    I hope this helps someone somewhere. Thanks for a great knowedge base!

Leave a Reply