Get Protected Directory Logins from Plesk

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

Script:

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

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?";
echo
mysql psa -uadmin -p`cat /etc/psa/.psa.shadow` -e ‘select pd.login, a.password, d.name, dirs.path from accounts a, pd_users pd, protected_dirs dirs, domains d WHERE a.id =
pd.account_id AND pd.pd_id = dirs.id AND dirs.dom_id = d.id AND dirs.path != "plesk-stat";’ | grep $1;[/code]

Usage:

[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! searchterm.co.uk admin
user searchterm test.co.uk admin
[root@mail bin]#
[/code]




No Comments


No comments yet.



Leave a Reply

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