Strong Password change
Hey what’s up, yeah i know its been a long time since i posted something.
Strong password change
Over the last years alot of things have been said about strong passwords and the meaning of a strong password, as the CPU power increases the number and range of charecters also increase. This makes things hard at many levels, from the users prespective think about a string that meets all the requesits and remember it, it’s only the first step, lately some have enven sugested that passwords in enviroments such as Local domains (Active Directory, OpenLDAP, etc), shouln’t even expire, this to me sounds crasy but i will not try to explain my point of vew instead i will use one of arguments wich i find reasonable valid and propose something that could help one to prevent users from abusing the system and create weak passwords
The increment a digit trick
This is probably one of the most konwn trick, works in every system i have found and been able to test, and is a valid arguement in the password change & secure password discution.
In almost every system, a user is initialy invited to set an initial password that meets a set of requirements like: lower and upper case digits and a simbol with a given minimum length, after a while the same user is invited to change that passsword, some time before it expires, and this is where the discution beguins.
What many say is True most users will take the old password and increment a digit or change the symbol, essentialy the structure of the password remainds the same.
One of the first questions one might ask is, Why is this a problem in a domain ? Well, if one consider the fact that most local domains will lock the user after 3 failed attempts, if the user relies on this trick its reasonable to assume that a malicious user will guess the new password before the user gets locked.
A Possible solution
In one of my last security conferences where i was a speaker, some one maded a question with a similar issue, meaning how to detect weak passwords, or password changes such as the one i described previously. One of methods used is the wordlist, this is an effective method unfortunatly this list will grow as IT and CPU power increases, reason why i don’t consider this as a reliable solution.
One of my favorite password cracking methods are the masks, wich efectify reduces the number of permutations and allows one to optimize the mask to something closer to what a user might chose in orther to remember. In this method a charecter range is setup using mask where every position in the password would be translated to a symbol:
- BahBeh: UllUll
- BahBeh123$: ULLULLDDDS
Given this example is easy to understand what means what, charters are organyzed by sets (Uppercase, Lowercase, Numbers, Symbols), when comparing to password masks becomes easy to verify if they are using the same mask, and prevent the user from using the same tick.
The Password change process usualy implemented as follows:
- Ask the user for the old password and the new password.
- Hash the old password
- Check if the old password hash is correct.
- Check password complexity.
- Hash the new password.
- Save the new password hash
Note that the old password can be found in plain, this allows one to translate the password to a mask force the user to change the mask of the password.
In short the new password change process would become.
- Ask the user for the old password and the new password.
- Hash the old password
- Check if the old password hash is correct.
- Translate the old password to mask.
- Translate the new password to mask.
- Check new password complexity.
- Compare old password mask and the new password mask.
- Hash the new password.
- Save the new password hash
Sounds easy right ? if one takes a closer look will become clear that this is allows other checks, and render’s the weak password wordlist irelevant.
For does who like to see the code here is sample implementation in python.