migration from ispcp

  • For that I need usual output from logs (as from ispcp) *-rqst-mngr

  • I didn't found the domain in the /etc/postfix/imscp/domains, but now i have admin panel and pma and i saw the domain's settings, and i found unlimited mail accounts.

    OS: Debian Buster

    i-MSCP: GIT 1.5.3-maintenance branch

    Edited once, last by Kika ().

  • yeah, problems with decrypting mail passwords. you must reset password in table (use clean not encrypted pass) set status and run again setup

  • in the /etc/postfix/imscp/mailboxes i found some mailbox with this domain.tld[hr]
    can i decrypt the real password for this users? (i have problem with 48 mailboxes)

    OS: Debian Buster

    i-MSCP: GIT 1.5.3-maintenance branch

    Edited once, last by Kika ().


  • in the /etc/postfix/imscp/mailboxes i found some mailbox with this domain.tld[hr]
    can i decrypt the real password for this users?


    if you have saved table for mail users yes:
    [code=php]<?php


    $key = 'putkeyhere';
    $iv = 'putivhere';
    $pass = 'putpasshere';


    echo decrypt_db_password($pass);


    function decrypt_db_password($password)
    {
    if ($password == '') { return ''; }


    if (extension_loaded('mcrypt')) {


    $text = @base64_decode($password . "\n");
    $td = @mcrypt_module_open('blowfish', '', 'cbc', '');


    // Initialize encryption
    @mcrypt_generic_init($td, $key, $iv);
    // Decrypt encrypted string
    $decrypted = @mdecrypt_generic($td, $text);
    @mcrypt_module_close($td);


    // Show string
    return trim($decrypted);
    } else {
    throw new Exception("PHP extension 'mcrypt' not loaded!");
    }
    }[/php]

  • this script is echo nothing. I inserted the $key and $iv from the ispcp's db key file, and i pasted from the db a mail password. I inserted an quote at the before and at the and of the decripted passwod and i see only "".

    OS: Debian Buster

    i-MSCP: GIT 1.5.3-maintenance branch

  • Sorry:
    [code=php]$key = 'putkey';
    $iv = 'putiv';
    $pass = 'putpass';


    var_dump(decrypt_db_password($pass, $key, $iv));


    function decrypt_db_password($password, $key, $iv){
    if ($password == '') { return ''; }


    if (extension_loaded('mcrypt')) {


    $text = base64_decode($password . "\n");
    $td = mcrypt_module_open('blowfish', '', 'cbc', '');


    // Initialize encryption
    mcrypt_generic_init($td, $key, $iv);
    // Decrypt encrypted string
    $decrypted = @mdecrypt_generic($td, $text);
    mcrypt_module_close($td);


    // Show string
    return trim($decrypted);
    } else {
    throw new Exception("PHP extension 'mcrypt' not loaded!");
    }
    }
    [/php]

  • I saw the new passwords and i think that i found lot of "wrong" passwords with status ok. Sometimes i just see only 1-3 characters in this field[hr]
    thanks, this is works perfectly.

    OS: Debian Buster

    i-MSCP: GIT 1.5.3-maintenance branch

    Edited once, last by Kika ().

  • This bug we discovered managed to ruin all mail and sql password. Do you have a backup of ispcp keys and table for mail and sql? if yes you can recover them. otherwise change them to random password and inform costumer to change those passwords. After you finish with passwords (before informing clients if necessary) run again setup to finish rebuild of all client configs.

    Edited once, last by oldev01 ().

  • i have only one question :)


    I loaded the old database, and your script can decrypt the passwords, but how can i encrypt with the new format before insert into the updated imscp database? or i must use password as plain text in the new database?

    OS: Debian Buster

    i-MSCP: GIT 1.5.3-maintenance branch

    Edited once, last by Kika ().