Details of Email, FTP, Database users from PSA database

In Plesk, PSA database stores details of email, ftp and database users in plain text format. So it is easy to get the details from the plesk database.

bash# mysql -u admin -p`cat /etc/psa/.psa.shadow`
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 95
Server version: 5.0.51 Source distribution

Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer.

mysql> use psa
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql>

EMAIL ACCOUNT DETAILS

mysql> SELECT mail.mail_name, accounts.password, domains.name FROM mail, accounts, domains WHERE domains.id=mail.dom_id AND mail.account_id=accounts.id;

Use following command.

mysql> SELECT CONCAT(mail.mail_name,’@’,domains.name) AS Email_Address , accounts.password AS Password FROM mail, domains, accounts WHERE domains.id=mail.dom_id AND mail.account_id=accounts.id;

DATABASE USER DETAILS

mysql> SELECT domains.name, data_bases.name, data_bases.type , db_users.login,accounts.password FROM domains, data_bases, db_users, accounts WHERE domains.id=data_bases.dom_id AND data_bases.id=db_users.db_id AND db_users.account_id=accounts.id;

FTP / SYSTEM USER DETAILS

mysql> SELECT domains.name, sys_users.login, accounts.password, sys_users.home, sys_users.shell, sys_users.quota FROM domains, accounts, hosting, sys_users WHERE domains.id=hosting.dom_id AND hosting.sys_user_id=sys_users.id AND sys_users.account_id=accounts.id;

IP Address DETAILS

mysql> SELECT domains.name, IP_Addresses.ip_address, IP_Addresses.mask, IP_Addresses.iface, IP_Addresses.type FROM domains, IP_Addresses, hosting WHERE domains.id=hosting.dom_id AND hosting.ip_address_id=IP_Addresses.id;

Originally posted by : Praveen’s Matrix

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s