Tuesday 1 May 2012

Reset Password for CMS Made Simple

How to Reset Admin Password for CMSMS?


Since Last few hour I was trying to recover admin password for one of my client admin panel user password and searched a lot on net but found no luck, Since I was having Db access So good idea from one post to change md5 encrypted password from table cms_users and I used md5 creator at http://md5encryption.com/


But that didn't solved my issue as it was found in many forums. So I got into little depth to solve it.

Find solution here:



after changing password with new md5 Created password from http://md5encryption.com/ in cms_users you have to do little changes in classes found at lib\classes\


class.user.inc.php



Change:


function SetPassword($password)
    {
        $this->password = md5(get_site_preference('sitemask','').$password);
    }



To:


function SetPassword($password)
    {
        $this->password = md5($password);

    }

class.useroperations.inc.php


Change:

if ($password != '')
        {
          $where[] = 'password = ?';
          $params[] = md5(get_site_preference('sitemask','').$password);
        }


To:

if ($password != '')
        {
          $where[] = 'password = ?';
          $params[] = md5($password);
        }


Actually CMSMS includes some more values to password before encrypting to which we have changed to normal md5 of password only.


Now you have login to admin site you have cracked password for CMSMS admin.







9 comments:

  1. what if I want to remove the md5 encryption at all? so the real password being saved into the database?

    ReplyDelete
  2. author gave me essential clues on resolving my similar problem. thanks!!!

    ReplyDelete
  3. @البغدادي. you could simply use $password and remove md5

    ReplyDelete
  4. @anton o: It's good to hear that it helped.

    ReplyDelete
  5. It's actually even simpler than this. Just look for the 'sitemask' entry in the site_prefs table and add this value to the front of your desired password before running through an online MD5 generator. e.g.

    sitepref="ABC1234"
    new password="MyPassowrd"

    Generate MD5 of "ABC1234MyPassowrd"

    and save the result to the password field in the users table.

    ReplyDelete
  6. Generate password Free Online : http://sefupwd.sebastienfuchs.net

    ReplyDelete
  7. very helpful. Thank you very much

    ReplyDelete