Get Protected Directory Logins from Plesk

Quick bash script to grep out protected directory logins from Plesk’s PSA database.


[code language=”bash”]#!/bin/bash

you=`who am i | cut -d’ ‘ -f1`;

echo -e "Hello $you, looking in the protected dirs password list for \033[33;1m$1\033[0m eh?";
mysql psa -uadmin -p`cat /etc/psa/.psa.shadow` -e ‘select pd.login, a.password,, dirs.path from accounts a, pd_users pd, protected_dirs dirs, domains d WHERE =
pd.account_id AND pd.pd_id = AND dirs.dom_id = AND dirs.path != "plesk-stat";’ | grep $1;[/code]


[code gutter=”false”][root@mail bin]# greppdirs searchterm[/code]

Output (user | pass | domain | path of dir):

[code gutter=”false”]Hello charles, looking in the protected dirs password list for searchterm eh?

admin p455! admin
user searchterm admin
[root@mail bin]#

No Comments

You can leave the first : )

Leave a Reply

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