|
|
Password SecurityFrom Security Lab WikiThis lab will illustrate how passwords can be broken and why it is important to choose strong passwords.
Background Readingwww.microsoft.com/protect/yourself/password/create.mspx en.wikipedia.org/wiki/Password_cracking Optionalhttp://en.wikipedia.org/wiki/Hash_function#Hash_function_algorithms Other resourceswww.outpost9.com/files/WordLists.html Goals
|
| Length | Combinations |
| 1 | 94 |
| 2 | 8,836 |
| 3 | 830,584 |
| 4 | 78,074,896 |
| 5 | 7,339,040,224 |
| 6 | 689,869,781,056 |
| 7 | 64,847,759,419,264 |
| 8 | 6,095,689,385,410,820 |
As you can see the number grows very quickly. Modern computers are very fast, but can they hash and compare 6,095 trillion strings very fast? What if passwords can be 20 characters long? That is 2,901,062,411,314,618,233,730,627,546,741,369,470,976 combinations by the way (at least according to the Ruby interpreter). How lucky would an attacker have to feel to try that on an average desktop? Of course, most password policies have a lower limit, so an attacker won’t have to bother with the cases that the length is less than that value, but as you can see from the chart, that is relatively few.
Answer questions 3 & 4.
If Cain is not started, start it up and click on the cracker tab. Since Cain already cracked the two passwords, we need to start over. Right click and choose remove all. As before find and copy the hash for two passwords. This time we are going to use shorter passwords: secret, and secret1. Right click and choose brute force.
For our purposes we will choose the predefined values, all letters and numbers, not including upper-case. To keep the estimated scan time down choose the max length to be the length of secret, 6 characters. Don’t forget, an attacker won’t know how long your password is, just the predefined max and min lengths. Click start. Look at the estimated time. Is it surprising, given the short range of lengths, and limited characters?
While Cain is chewing on our password, answer question 5.
Now crack secret1, don’t forget to change the range to 7, also change the minimum range to 7, so it only tries all possibilities of length 7. Do you think it will save a significant amount of time?
Look at the estimated time, and answer questions 6 and 7.
If you don’t want to wait around, you can cancel the attack.
Now try to brute force at least of your passwords. For settings, change the charset to all normal keyboard characters (a-zA-Z0-9, and all symbols) with a minimum length of 5(use 1 if the length of the password is < 5) and maximum is 20(use the length +5 if it is longer than that).
Run it and note the estimated time. Answer question 8 and 9 . You can stop Cain unless you want to wait until it cracks it.
Aren’t you glad that most hackers don’t have access to supercomputer clusters? If they did, do you think it would make a big enough difference to matter if the password is sufficiently long? It probably will not, unless the attacker is a vampire or incredibly lucky.
Social Engineering
Another common way to get passwords is to simply ask for them! This is part of an attack called social engineering. These attacks may be in the form of phishing emails, phone calls from the "IT staff", or even in person. Avoiding these attacks are fairly simple if you remember one thing: Anyone who might legitimately need access to your account/data will already have administrator access(commonly called root) and not need it. If this topic has not yet been covered in class it will.
Choosing a good password
Before we talk about choosing a good password it is worth noting that programs that store passwords have mechanisms to help protect your password. Beyond the obvious ones of making sure attackers can’t access the database and enforcing rules(password length, using case, numbers, and symbols) there is another way that helps. It involves attaching other data to the password before hashing it. This is called salting the password. A salt is also saved along with the password, and is usually composed of constant and random data. In stronger password schemes the salt is stored in a different place than the password, but on less critical systems in may be stored in the same database table. There are other methods like hashing the password, then appending the salt and hashing the entire byte string. These different sequences will have to be discovered by the attacker to be successful.
Here is a simple Ruby method that combines static data along with the password and salt to produce a 512 bit string.
def self.encrypted_password(password,salt)
hash = "f5g597@r" + Digest::SHA256.hexdigest(password) + "5g56tg"d4Gt45fdgdd45re4234R5445!DF4fh57"
+ salt
Digest::SHA512.hexdigest(hash)
end
So even if an attacker got a hold of the hashed password, it would be very challenging to crack it without the salt and source code, and this snippet is not as good as it could be. Don't worry if you don't understand the above code.
Of course, if your password is simple and the website does not take special care against brute-force and dictionary attacks it doesn't matter if the attacker can get the source code or salt. They will own you easily.
A strong password that is easily remembered (never write down your passwords) but difficult to guess can be tricky. Many people put lots of personal information in publically accessible places such as Facebook and MySpace, attackers can often use this information to more easily guess your password. Email addresses are often used as user names and to make matters worse, people often use the same password for everything. Therefore, if your facebook page has enough clues that someone can guess your password, and your email address is listed, this could lead to identity theft.
Many places offer password resets when just given a valid email address, and if the attacker got into your email account, they now own nearly everything. Banks and other critical institutions are becoming more sophisticated, making it tougher for the bad guys, but is not fool-proof. If that is not bad enough, many businesses have lax employee password standards, so your weak password that is easy to remember can cost your employer a lot as well.
If you have not read the information in the first link please do so now.
Answer the remaining questions.
Questions
- Can you give an example of a website implementing a policy that is designed to thwart dictionary based attacks?
- Of your list of passwords, how many were cracked? Was it surprising? If you didn't use the case permutation option do you think that might have caused it to crack the password? In other words is your password likely in the dictionaries but you have one or more case changes?
- From an attackers perspective what is the problem with brute forcing?
- From an end-users point of view, what is the problem with a long password?
- Will the scan likely take the entire estimated time? Why or why not?
- If the estimated time is more for secret1 than it was for secret, is it significantly longer? What does that say about the importance of password length?
- Do the results so far imply anything about the importance of avoiding dictionary based passwords?
- How long is the estimated time? If it is in a notation you don’t understand raise your hand for help.
- Will this method guarantee to crack the password given enough time? Assume that all characters in the password are not whitespace but otherwise on a standard english-101 keyboard.
- You are trying to come up with a strong password. One way is to mutate a favorite poem or song into a password. Assume you are a huge fan of The Cure(who isn't?), so you u following lyrics: “it fades and spins-sing out loud-we all die-laughing into the fire- is it always like this?”*** Come up with a mnemonic based password on this that is not dictionary based and includes numbers and symbols.
- If you have those lyrics posted on your MySpace page and is public, do you think that is a problem? Think about if the attacker knows you and your username or is just a random stranger that crossed by your page, but doesn’t have knowledge of any of your usernames, email addresses, etc.
- There are third party programs that encrypt and store passwords, either on your system or online. Hopefully, they properly encrypt your passwords, but that means you need to create and remember the passphrase to unlock the encryption. This might be better, since remembering one password is easier than remembering many. It also makes it easier to avoid using the same password in multiple places. Is it really better, or is putting all your security eggs in one basket a bad idea? There is not a right or wrong answer, just give your opinion.
*** Siamese Twins by The Cure – It what was playing when I wrote that question. No, my passwords are not based on this or any Cure song. :)~