Posts Tagged ‘password cracking’

The password problem

Friday, November 27th, 2009

Odds are good if you’ve reached this blog, you have an account on at least one website somewhere on the wild wild web. This account could be on a web application ranging from something as critical as a finical institution or your primary email account to something as trivial as your account on some random blog. I’ve got far too many to even be able to number, falling everywhere in between those two lines, and have created my fair share of passwords. Normally, this is the point where the blogger starts ranting about “longer passwords” or “use a passPHRASE” or “use special characters.” This time however, I’m pointing the finger at the application designers.

Originally, this post was going to be little more than my frustration with not being able to use passwords that I desired, due to restrictive requirements on applications. After gathering some data, to have a soap box to stand on, I realized that some of these “requirements” actually go beyond the surface level annoyance and actually affect the security of your account directly. Some of these applications go as far as to actually prevent you from using a secure password or reveal other weaknesses in the application’s design. I’m sure this isn’t a new find by any means, but some of the “requirements” I’ve seen are pretty outrageous. The most startling bit is a good majority of the examples I’ll be using in this post have come from accounts falling into that “critical” category.

Before I go on and discuss the various “vulnerabilities”, I’d like to note that the list below is definitely not a comprehensive list of all web application password vulnerabilities. Rather, everything below was gathered from requirement messages listed at the time of creating the password and other things I noticed while creating the account. The purpose of this list is to explain each issue, on both a technical and non-technical level, as well as to provide recommendations for end users encountering each. Examples used here are gathered from live, current web applications to represent the current issue as well as to provide real world examples as teaching tools for detection.

Restrictive Length

This was probably the most prevalent poor password requirement I came across, which is odd to me as I’ve never seen any reason to restrict a user’s password other than to require a minimum length. Despite this, we see the following types of messages all across the web:

Password must be 6 to 8 characters in length

Please enter a password that has a maximum length of 12 characters

By reducing limiting the number of characters a password can contain the number of possible passwords, the keyspace, is also reduced. This means that a malicious user who is either brute forcing the application or has obtained a copy of the hash and is cracking it has to check a smaller number of passwords.

Other than simply restricting length through verbose and obnoxious warnings, some developers will simply truncate your password. In some situations, this truncation happened through an html attribute defining the maximum length of the password creation field as well as the login field. This double-combo actually makes things worse as it may be some time before you notice that your 23 character password is being cut-off at 12 characters.

Restrictive Character Set

I can almost build a case for these requirements. Almost. I’ve spoken with developers who have restricted characters allowed in your password by the same rules they disallow characters for SQL injection blocking or cross site scripting prevention. In other cases, I’ve seen character sets reduced by case-insensitivity.

Contain no spaces or special characters (eg <, &, >, *, $, @)

No spaces or invalid symbols

Contain 6 to 8 characters – at least one letter and one number (not case sensitive)

In these examples you can see developers trying to limit their attack surface by preventing any sort of attack on their application through the password field. Where this argument breaks down is, a proper application should be one-way hashing the passwords. When the password is hashed these special characters are eliminated and thus rendered safe.

In the third example, you can see that the keyspace is reduced even further by removing 26 characters, either the upper or lower case letters. At the same time they have reduced the keyspace characters to 36, they’ve also limited password length on both the upper and lower end.The combination of these two restrictions effectively reduces the keyspace from 218,340,105,584,896 (8 characters, upper/lower-case, numbers) to 2,821,049,441,280 (6-8 characters, case insensitive, numbers), just over 1% of the password possibilities.

Defending yourself

In many cases, when you come upon a web application as inherently insecure as the ones listed above it’s probably best to simply walk away and not bother with it, however; there are cases where you may need to create and use and account. It’s possible to mitigate some of the risks of restrictive passwords by paying attention and adjusting your password accordingly.

Probably the greatest risk of the issues outlined above is the possibility of your password being compromised by another user. As it’s impossible to create a stronger password than the application will allow, this reduces our options drastically. I suggest creating a couple passwords and then group accounts into “security levels” based on their requirements. By having multiple passwords and using them on web applications with varying levels of security, you can ensure that a compromise due to one of these poor password policies is limited to a password only used on other such sites.

Detection is important because without it you aren’t able to correctly classify the security level of the application’s password policies. Beyond simply looking at the requirements listed, a complex password designed to trigger applications with poor password management to fail can be used to test the application.

#th!$iSaG<><>|)’test–p@ssword”!*

The password above can be used to test applications. By including common SQL injection characters, cross site scripting characters, upper/lower case, numbers, commonly denied symbols and a length 33 characters of  you can test the whole array of restrictions. Beyond simply testing the restrictions, it actively tests the application for SQL injection potential. The ‘ and ” characters included in the password are designed to trigger SQL errors if they are not handled (either by hashing or SQL character stripping.) An application that throws an error on this password should actually be considered significantly less secure.

crackIt: aircrack-ng automated

Saturday, November 15th, 2008

I was playing around with my wireless network early today and realized I didn’t have the key written down near by where I was working. Rather than expending the effort of getting up and moving, I decided I’d just crack it.

After starting up airodump-ng I was looking at aircrack-ng’s man page. Trying to decide which options would make it crack most effectively. After browsing the man page for half an hour or so I decided that they should be run in a certain order for best effect. Still being lazy, I began to script this up. I added some ‘fluff’ and called it crackIt.

crackIt uses 20 different permutations of aircrack-ng. These different configurations are run from fastest targetted, least reliable to slow, broad, sure-fire methods. I chose to order it this way because in my experience, the targeted, least reliable method is effective in a large number of cases.

crackIt begins using aircrack’s standard configuration with the fudge factor lowered to 1. The fudge factor is used to determine how many votes should required for a key to be ‘valid’. The largest number of votes for each key, the key in the left most position’s parenthesis value, is divided by the fudge factor. The result is the minimum number of votes required to be ‘valid.’ By reducing this to one, we provide a very targeted, quick method of attack. This method is prone to false positives or failing.

Next, crackIt uses the standard configuration of aircrack, raising the fudge factor back to the default 2. It then moves onward to try again with each of the 17 Korek attacks omitted. The Korek attacks are prone to large numbers of false positives. In the event both the fast-crack and default modes in aircrack fail, odds are good that one of these is to blame.

Finally, crackIt uses “an experimental single brute-force attack which should only be used when the standard attack mode fails with more than one million IVs.” aircrack won’t even let you run this method without 780,000 IVs. If you’ve left airodump-ng running, by the time it gets to this mode, we should have atleast that.

Technical details, usage, and future plans can be found in the fully commented code here.

References:

aircrack-ng man page

http://www.aircrack-ng.org/doku.php?id=aircrack-ng

Reading Rainbow: Episode 8

Saturday, June 7th, 2008

Restrictive passwords make cracking more difficult by requiring that users use a wider range of characters; however, can restrictive password policies actually decrease time required to crack? This blog goes into the math behind it. http://lukenotricks.blogspot.com/2008/03/more-on-counting-restrictive-password.htm

Mozilla has a new campaign to break the world record for number of downloads in 24 hours. They have even gone to allowing people to pledge downloads, to be sure they accomplish their goal. This is an interesting marketing campaign. http://www.spreadfirefox.com/en-US/worldrecord/

In a previous post (America’s Cyber defense or lack there of) I pointed out problems with foreign hackers and our government. Here are two articles as a semi-continuation of the saga. http://www.scmagazineus.com/Potential-security-breach-by-China/article/110790/ http://www.thehindubusinessline.com/2008/06/04/stories/2008060451781200.htm

If you are considering being in the IT field or are looking to hire new IT staff, this article is well worth a read. 30 items that IT staff should know. I don’t agree with all 30, but the list itself is something to be looked at and will help you evaluate yourself or potential staff. http://www.infoworld.com/article/08/06/02/23FE-how-to-fire-IT-staff-skills-list_1.html

After battling with an .htaccess problem all day long I ended up at this article. It didn’t solve my problem, but is a great source of information on all things .htaccess. http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/

pwlib.java

Tuesday, May 13th, 2008

I have finished up the first version of pwlib.java. It was created in Java 1.4, because I haven’t bothered to update Java in ages. I should be revising it for 1.6 soon enough, but this is something to get you going. I haven’t done a whole lot of testing on it just yet, so feel free to post any bugs you may find.

Currently it only supports hashing for md5 and SHA1, but that will change later on. Right now I’m just trying to get the code base out in all four languages. Next up will be python. Enjoy.

pwlib.java (Java 1.4)

pwlib.php

Saturday, May 3rd, 2008

This is my first build of the php version of pwlib. Nothing is quit set in stone yet and for all I know I might scrap the whole thing. This should be enough to see how it will interface. If you have and suggestions or would like to see a feature put in, post a comment and I’ll look into it.

PHP 4 Version: http://www.samurainet.org/pwlib/php/pwlib-php4.src

PHP 5 Version:http://www.samurainet.org/pwlib/php/pwlib-php5.src

Wordlist (its just for testing): http://www.samurainet.org/pwlib/php/test.txt

I still need to finish optimizing the code as well as making some of the features more robust. Enjoy the code.

Multi-language password cracking libraries

Thursday, April 24th, 2008

After creating customized password cracking apps for some time, I have finally grown tired of using different alogirthms with no real flexability in them so I have decided to create a library to do this for me. Since I work in a few languages, I will be building these in: Java, C++, Python, and PHP.

The library itself will be a collection of functions used to generate passwords and hashes to be used in cracking or brute forcing. For passwords the library will provide functionality for using dictionary files and generating brute force lists of minimum length n to maximum length m for ASCII x through y. The hashes will include md5 and sha1 built in and I plan to allow custom algorithms to be built for it as a plugin or passed in function, however; that is still in the planing stages.

As soon as I set it up, I will make daily builds available and post that link under this sub-category along with updates. Comments and suggestions are appreciated.