Shell-Script
- #!/usr/bin/php -q
- <?php
- ## Autor: Knut Herter
- ## Datum: 20.01.2009
- ## Web : http://www.systemtechnics.de
- ##
- ## Usage: decrypt_mailpw.php |grep whatever_you_want
- ##
- ## Example: decrypt_mailpw.php |grep admin
- ###
- # FIRST CHANGE THIS VALUES !
- ###
- $SQLHST = "localhost";
- $SQLPW = "DEIN_GEHEIMES_PASSWORT";
- $SQLUSR = "root";
- $ISPCPDB = "easyscp";
- # if error_reporting on you see some session errors at cli
- error_reporting(1);
- #################################
- #### Do not change from here ####
- $QUERY = "
- SELECT `mail_users`.mail_acc,
- `mail_users`.mail_pass,
- `domain`.domain_name
- FROM `domain`
- INNER JOIN `mail_users` ON (`mail_users`.domain_id = `domain`.domain_id)
- WHERE `mail_type` LIKE 'normal_mail' OR `mail_type` LIKE 'normal_mail,normal_forward'";
- require '/var/www/easyscp/gui/include/easyscp-lib.php';
- $link = mysql_connect( $SQLHST, $SQLUSR, $SQLPW);
- if (!$link) {
- die('keine Verbindung m?glich: ' . mysql_error());
- }
- mysql_select_db( $ISPCPDB, $link) or die('Could not select database.');
- $result = mysql_query($QUERY);
- if (!$result) {
- die('Ung?ltige Abfrage: ' . mysql_error());
- }
- $FORMAT = "Domain MailAdr: [ %s@%s ] Passwort: [ %s ]\n";
- while ($row = mysql_fetch_row($result)) {
- printf ( $FORMAT, $row[0], $row[2], decrypt_db_password ($row[1]));
- }
- printf ("\n");
- mysql_close($link);
- ####### DOMAINALIASE
- $QUERY = "
- SELECT `mail_users`.mail_acc,
- `mail_users`.mail_pass,
- `domain_aliasses`.alias_name
- FROM `domain_aliasses`
- INNER JOIN `mail_users` ON (`mail_users`.sub_id = `domain_aliasses`.alias_id)
- WHERE `mail_type` LIKE 'alias_mail' OR `mail_type` LIKE 'alias_mail,alias_forward'";
- $link = mysql_connect( $SQLHST, $SQLUSR, $SQLPW);
- if (!$link) {
- die('keine Verbindung m?glich: ' . mysql_error());
- }
- mysql_select_db( $ISPCPDB, $link) or die('Could not select database.');
- $result = mysql_query($QUERY);
- if (!$result) {
- die('Ung?ltige Abfrage: ' . mysql_error());
- }
- $FORMAT = "Aliasdomain MailAdr: [ %s@%s ] Passwort: [ %s ]\n";
- while ($row = mysql_fetch_row($result)) {
- printf ( $FORMAT, $row[0], $row[2], decrypt_db_password ($row[1]));
- }
- printf ("\n");
- mysql_close($link);
Passwörter können ausgelesen werden. EasySCP ist ja aus imscp entstanden. Einfach Zeile 19 entsprechend anpassen.