Categories
Linux Plesk

Lookup client passwords on Plesk

1. Connect to the Plesk Database

mysql -u admin -p`cat /etc/psa/.psa.shadow`
use psa

2. Select one of the following commands:

Get all e-mail account passwords:

SELECT CONCAT_WS('@',mail.mail_name,domains.name),accounts.password
FROM domains,mail,accounts
WHERE domains.id=mail.dom_id AND accounts.id=mail.account_id
ORDER BY domains.name ASC,mail.mail_name ASC;

Email account passwords for a specific domain:

SELECT account_id AS �ID�, mail_name AS �USERNAME�, password AS �PASSWORD�, postbox as �MAILBOX?�, name AS �DOMAIN�, redir_addr as REDIRECT 
FROM mail M, domains D, accounts A 
WHERE M.account_id = A.id AND M.dom_id = D.id AND D.name=�****DOMAIN_NAME****�;

Get e-mail account passwords that are made up of only letters:

SELECT CONCAT_WS('@',mail.mail_name,domains.name),accounts.password
FROM domains,mail,accounts
WHERE domains.id=mail.dom_id AND accounts.id=mail.account_id
AND accounts.password RLIKE BINARY '^[a-z]+$'
ORDER BY domains.name ASC,mail.mail_name ASC;

Get e-mail account passwords that are made up of only numbers:

SELECT CONCAT_WS('@',mail.mail_name,domains.name),accounts.password
FROM domains,mail,accounts
WHERE domains.id=mail.dom_id AND accounts.id=mail.account_id
AND accounts.password RLIKE  '^[0-9]+$'
ORDER BY domains.name ASC,mail.mail_name ASC;

Find domains that are using catch-all accounts:

SELECT d.name AS domains, p.value AS catchall_address
FROM Parameters p, DomainServices ds, domains d
WHERE d.id = ds.dom_id AND ds.parameters_id = p.id AND p.parameter = 'catch_addr'
ORDER BY d.name;

Lookup FTP credentials:

SELECT account_id AS �ID�, login AS �USERNAME�, password AS �PASSWORD�, home AS �HOMEDIR� 
FROM sys_users S, accounts A 
WHERE S.account_id = A.id;

By Mik Canavan

I'm a tech obsessed and self-confessed geek. As the Technical Director at Fivenines UK, I'm lucky that I get to faf with gadgets, design websites and fix servers...

2 replies on “Lookup client passwords on Plesk”

Leave a Reply

Your email address will not be published. Required fields are marked *