forked from kissthink/scripts
-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathPlesk-credetial-gatherer.sh
96 lines (84 loc) · 3.25 KB
/
Plesk-credetial-gatherer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
#Pulls the credentials (searchable) from the plesk PSA database. Also determins what version of plesk is running to get the correct command to retrieve the password > version 10.3
# Usage: ./Plesk-credetial-gatherer.sh
#
# By: Leon Teale (RandomStorm)
#
while :
do
clear
echo "######################"
echo "* "$blue MENU$normal" *"
echo "*--------------------*"
echo "* 1) FTP *"
echo "* 2) Email *"
echo "* 3) Search *"
echo "* 4) Plesk Pass *"
echo "* 5) Power user mode *"
echo "* *"
echo "* 0) exit *"
echo "######################"
read opt
case $opt in
1) mysql -uadmin psa -p`cat /etc/psa/.psa.shadow` -e "SELECT login AS FTP_USER,password AS FTP_PASS,home AS DOMAIN_ROOT,accounts.id,sys_users.account_id FROM accounts, sys_users WHERE accounts.id=sys_users.account_id;"
read enterkey;;
2) mysql -uadmin psa -p`cat /etc/psa/.psa.shadow` -e "SELECT accounts.id, mail.mail_name, accounts.password, domains.name FROM domains LEFT JOIN mail ON domains.id = mail.dom_id LEFT JOIN accounts ON mail.account_id = accounts.id;"
read enterkey;;
3)
echo "############################"
echo "* Search in: *"
echo "****************************"
echo "* 1) FTP *"
echo "* 2) EMAIL *"
echo "* 3) ALL *"
echo "############################"
read option
case $option in
1) echo "Enter Search Term"
read search;
mysql -uadmin psa -p`cat /etc/psa/.psa.shadow` -e "SELECT login AS FTP_USER,password AS FTP_PASS,home AS DOMAIN_ROOT,accounts.id,sys_users.account_id FROM accounts, sys_users WHERE accounts.id=sys_users.account_id;" | grep "$search" | awk '{ print "User: "$1 "\n" "Pass: "$2 "\n" "Home_Path: "$3"\n"}';
read enterkey;;
2) echo "Enter Search Term"
read search;
mysql -uadmin psa -p`cat /etc/psa/.psa.shadow` -e "SELECT accounts.id, mail.mail_name, accounts.password, domains.name FROM domains LEFT JOIN mail ON domains.id = mail.dom_id LEFT JOIN accounts ON mail.account_id = accounts.id;" | grep "$search" | awk '{ print $2"@"$4 " " "\n" "Pass:"$3"\n"}';
read enterkey;;
3) echo "Enter Search Term"
read search;
echo ""
echo "FTP"
mysql -uadmin psa -p`cat /etc/psa/.psa.shadow` -e "SELECT login AS FTP_USER,password AS FTP_PASS,home AS DOMAIN_ROOT,accounts.id,sys_users.account_id FROM accounts, sys_users WHERE accounts.id=sys_users.account_id;" | grep "$search" | awk '{ print "User: "$1 "\n" "Pass: "$2 "\n" "Home_Path: "$3"\n"}';
echo ""
echo "EMAIL"
mysql -uadmin psa -p`cat /etc/psa/.psa.shadow` -e "SELECT accounts.id, mail.mail_name, accounts.password, domains.name FROM domains LEFT JOIN mail ON domains.id = mail.dom_id LEFT JOIN accounts ON mail.account_id = accounts.id;" | grep "$search" | awk '{ print $2"@"$4 " " "\n""Pass:"$3 "\n"}';
read enterkey;;
esac;;
4) /usr/local/psa/bin/admin --show-password;
read enterkey;;
5)
echo "############################"
echo "* Power User mode: *"
echo "****************************"
echo "* 1) On *"
echo "* 2) Off *"
echo "* *"
echo "* 0) exit *"
echo "############################"
read option
case $option in
1) /usr/local/psa/bin/poweruser --on
echo "Power User mode On"
read enterkey;;
2) /usr/local/psa/bin/poweruser --off
echo "Power User mode Off"
read enterkey;;
0) echo "Exiting"
exit 1;;
*) echo "please Enter A Valid Option"
read enterkey;;
esac;;
0) echo "Exiting"
exit 1;;
*) echo "please Enter A Valid Option"
read enterkey;;
esac
done