Current time: 11-16-2024, 04:42 PM Hello There, Guest! (LoginRegister)


Post Reply 
encrypt mail passwords
Author Message
gandalf4711 Offline
Junior Member
*

Posts: 18
Joined: Jan 2009
Reputation: 0
Post: #3
RE: encrypt mail passwords
Es gibt ein kleines Script um die Mail PW auszulesen. Ich weis leider nicht ob es bei deiner Version funtz aber ein Versuch schadet nicht...

Code:
#!/usr/bin/php -q

<?php

## Autor: Knut Herter
## Datum: 06.10.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";
$SQLUSR  = "root";
$ISPCPDB = "ispcp";

# if error_reporting on, you see some session errors at cli
error_reporting(0);

#################################
#### Do not change from here ####

echo "MySQL password for $SQLUSR@$SQLHST: ";
system('stty -echo');
$SQLPW = trim(fgets(STDIN));
system('stty echo');

$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/ispcp/gui/include/ispcp-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());
}

printf ("\n");

$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);

?>

Den Code hab ich mal hier gefunden ...

Du musst evtl. noch den SQL Host bzw Benutzer und die Datenbank ändern.
Am Besten über die Console aufrufen.

Grüße
01-05-2012 08:15 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
encrypt mail passwords - johreini - 01-03-2012, 05:32 AM
RE: encrypt mail passwords - joximu - 01-03-2012, 09:38 AM
RE: encrypt mail passwords - gandalf4711 - 01-05-2012 08:15 AM
RE: encrypt mail passwords - joximu - 01-05-2012, 10:20 AM
RE: encrypt mail passwords - Knut - 01-06-2012, 05:05 PM

Forum Jump:


User(s) browsing this thread: 2 Guest(s)