How I Cracked Your Windows Password (Part 2)
How I Cracked Your Windows Password (Part 2)
How I Cracked Your Windows Password (Part 2)
http://www.windowsecurity.com/articles-tutorials/authentication_and_en...
(http://www.windowsecurity.com)
Home
Home
Products
Reviews
Free Tools
Blogs
Security Tests
Forums
White Papers
Contact Us
Going through the process of cracking passwords with different free tolls whilst providing tips for defending your password from being cracked. If you would like to read the first part in this article series please go to How I Cracked your Windows Password (Part 1) (http://www.windowsecurity.com/articles/How-Cracked-WindowsPassword-Part1.html).
Introduction
In the first part of this series we examined password hashes and the mechanisms Windows utilizes to create and store those values. We also touched upon the weaknesses of each method and possible avenues that can be used to crack those passwords. In the second and final article in this series I will actually walk you through the process of cracking passwords with different free tools and provide some tips for defending against having your password cracked. It is always crucial to note that the techniques shown here are strictly for educational purposes and should not be used against systems for which you do not have authorization for.
(http://banman.isoftmarketing.com/a.aspx?Task=Click&ZoneID=76&CampaignID=2746&AdvertiserID=140&
BannerID=1967&SiteID=6&RandomNumber=543821606&Keywords=articlestutorialsauthenticationandencryption%2chowcrackedwindowspasswordpart2)
Physical Access
If you have physical access, one of the most effective methods is to boot the computer into a different operating system. If you are comfortable using Linux then this means you can simply boot to a Linux live CD that is capable of reading NTFS drives, mount the Windows partition, and copy the SAM file to external media. If you are not quite comfortable doing this, you can use P. Nordahls famed Offline NT Password Editor, available here (http://pogostick.net/~pnh/ntpasswd/). This is a bootable Linux distribution designed to aid system users who have forgotten their passwords by allowing them to reset them. The software takes the users input, creates a valid hash, and replaces the old hash in the SAM file with the new one. This is useful to us because we can also use the distribution to simply read the SAM file and get the hash data. In order to do this, boot from the CD image and select your system partition, the location of the SAM file and registry hives, choose the password reset option [1], launch the built in registry editor [9], browse to SAM\Domain\Account\Users, browse to the directory of the user you wish to access, and use the cat command to view the hash contained in the files. The output will be in hex format, but it works with a simple conversion.
1 of 5
3/10/2014 4:52 PM
http://www.windowsecurity.com/articles-tutorials/authentication_and_en...
Figure 1: Hex output of the SAM hash Before using the Offline NT Password Editor to actually reset a password, be sure that you are not using Encrypted File System (EFS) on anything released after Windows XP/2003. If you do this, it will cause the operating system to lose its EFS keys, resulting in more problems than just a forgotten password.
Console Access
If you are performing password auditing activities without physical access to the device in question, but you still have console access through remote desktop or VNC, then you can obtain password hashes through the use Fizzgigs fgdump utility, obtainable here (http://www.foofus.net/fizzgig/fgdump/). Once you have downloaded fgdump to host you can simply run it with no options to create a dump of the local machine SAM file.
Figure 2: Confirmation the Fgdump Utility Ran Correctly Once this is completed, a file will be generated in the same directory the utility was launched from that contains a list of all user accounts, their LM hashes, and their NTLMv2 hashes.
Network Access
Finally, if you do not have any interactive access to the machine that has the hashes you want, your best bet is to attempt to sniff the hashes as they travel across the network during the authentication process. Of course, this will only work if the client is authenticating to a domain controller or accessing resources on another client, otherwise, you are more out of luck than a one armed man in a paper hanging contest. If you are on the same network segment as the target client you can use the Cain and Abel program to intercept the password hashes as they are transmitted between devices. Cain and Abel is a free utility downloadable from here (http://www.oxid.it/cain.html). Using Cain and Abel you can initiate a process called ARP cache poisoning, which is a man in the middle attack that takes advantage of the ARP protocol to route the traffic between two hosts through your computer. While ARP cache poisoning is active you can use Cain and Abels built in network sniffer, making it possible for you to intercept NTLM password hashes that are being communicated between the poisoned hosts. The theory behind ARP cache poisoning and how to do
2 of 5
3/10/2014 4:52 PM
http://www.windowsecurity.com/articles-tutorials/authentication_and_en...
it are another lesson in itself and a bit beyond the scope of this article, but if you wish to learn more about ARP cache poisoning you can do so here (http://www.chrissanders.org /?p=121).
Figure 4: Accepted Formatting of Passwords Hashes If you extracted your password hashes manually you will need to create a file with a line entry for every user account. Each line should contain the username, the relative identifier (RID) portion of the users SID, and the hashes. The format of these elements should be: Username:RID:LMHash:NTLMHash::: Browse to this file, select it, and click next to import the hashes into Cain and Abel. Once this is done, you can right click the account whose password you want to crack, select the Brute Force Attack option, and choose LM hashes. The brute force attack method attempts every possible password combination against the hash value until it finds a match. On the screen that follows you can select the characters you want to use for the brute force attack and the minimum and maximum password lengths. Notice that the character set is automatically configured to use only uppercase characters and number with a maximum length of 7, due to the characteristics of LM hashes. In our example scenario where we have a password of PassWord123 we will see immediate partial results as the program returns that Plaintext of 664345140A852F61 is D123. We have already cracked the second half of the password hash. On a modern computer, going through every single possible password combination should take no longer than 2 to 3 hours, guaranteeing an eventual success.
3 of 5
3/10/2014 4:52 PM
http://www.windowsecurity.com/articles-tutorials/authentication_and_en...
Figure 6: John the Ripper Attempting to Crack a Password Once it has completed, John the Ripper displays the cracked passwords and stores the results in its john.pot file. In most situations the default cracking mode is fine, but John the Ripper also has these cracking modes available: Single Crack Mode Uses variations of the account name Wordlist Mode Relies on a dictionary for password guesses Incremental Mode Relies on a brute-force style attack External Mode Relies on another (user supplied) application for password guessing John is very efficient in all of its cracking modes and is my typical program of choice for password cracking.
Disable LM Hashing
By now you should be thoroughly versed on the weaknesses of LM hashes. The good thing for us is that we do not have to use them anymore. Modern Windows operating systems can be configured to use NTLMv2 exclusively with a few registry modifications. You can disable the storage of LM hashes by browsing to HKLM\System\CurrentControlSet\Control\LSA in the registry. Once there, create a DWORD key named NoLMHash, with a value of 1. Another step is to disable LM authentication across the network. Once again, browse to HKLM\CurrentControlSet\Control\LSA. Once there, locate the key named LMCompatibiltyLevel. This can be set to 3 to send NTLMv2 authentication only which is a great setting for domain clients. The alternative is to set this value to 5 which configured the device to only accept NTLMv2 authentication requests, which is great for servers. The only instance in which these settings might cause an issue are cases in which you have Windows NT 4 and older client on your network. However, in all honesty, if you still have those types of systems on your network then getting rid of them is the best security device I can give you.
Use SYSKEY
SYSKEY is a Windows feature which can be implemented to add an extra 128 bits of encryption to the SAM file. SYSKEY works by the use of a user created key which is used to encrypt the SAM file. Once enabled, SYSKEY cannot be disabled. Its important to keep in mind that SYSKEY only protects the SAM file itself, securing it against being copied. SYSKEY does NOT protect against tools which extract hashes from running memory, such as Cain and fgdump. You can read more about SYSKEY at http://support.microsoft.com/kb/143475 (http://support.microsoft.com/kb/143475).
4 of 5
3/10/2014 4:52 PM
http://www.windowsecurity.com/articles-tutorials/authentication_and_en...
Conclusion
Password cracking is an instrumental skill for someone attempting to break into a system, and because of this it is a necessity that system administrators understand how passwords are stored, stolen, and cracked. As potential intruders poke and prod at systems their mouths will water at the sight of an LM hash and their goal will be more than half way completed if users are using simple passwords. Remember, knowing is half the battle, so if you take this information and do nothing about it you are only half way there. Using the defensive techniques provided you can help deter attackers from compromising passwords of your systems. If you would like to read the first part in this article series please go to How I Cracked your Windows Password (Part 1) (http://www.windowsecurity.com/articles/How-Cracked-WindowsPassword-Part1.html).
See Also
How I Cracked your Windows Password (Part 1) (http://www.windowsecurity.com/articles-tutorials/authentication_and_encryption/How-Cracked-Windows-Password-Part1.html)
on 16 Jan. 2013 (2013-01-16 06:56) by Chris Sanders
Dissecting the Pass the Hash Attack (http://www.windowsecurity.com/articles-tutorials/misc_network_security/Dissecting-Pass-Hash-Attack.html) on 23 Jan. 2013 (2013-01-23 17:24)
by Chris Sanders
Protect Against Weak Authentication Protocols and Passwords (http://www.windowsecurity.com/articles-tutorials/authentication_and_encryption/Protect-Weak-Authentication-ProtocolsPasswords.html) on 23 Jan. 2013 (2013-01-23 17:21) by Derek Melber Rainbow Tables & RainbowCrack Introduction (http://www.windowsecurity.com/whitepapers/cryptography/Rainbow_Tables__RainbowCrack_Introduction1614.html)
on 19 July 2013 (2013-07-19 12:47) by Chris Gates
Top 10 Windows Security Configurations: Where and How! (Part 2) (http://www.windowsecurity.com/articles-tutorials/authentication_and_encryption/Top-10-Windows-SecurityConfigurations-Where-How-Part2.html) on 23 Jan. 2013 (2013-01-23 17:25) by Derek Melber Understanding Man-in-the-Middle Attacks ARP Cache Poisoning (Part 1) (http://www.windowsecurity.com/articles-tutorials/authentication_and_encryption/Understanding-Man-inthe-Middle-Attacks-ARP-Part1.html) on 23 Jan. 2013 (2013-01-23 18:29) by Chris Sanders Your Quick Guide to Common Attacks (http://www.windowsecurity.com/articles-tutorials/misc_network_security/Common_Attacks.html) on 23 Jan. 2013 (2013-01-23 18:11)
by Robert J. Shimonski
Windows Server 2008 / 2003 & Windows 7 networking resource site. (http://www.windowsnetworking.com/)
Microsoft ISA Server Firewall Resource Site: Articles & Tutorials (http://www.isaserver.org/)
Networking & Server software / hardware for Windows 2003, 2000, NT & Linux (http://www.wservernews.com/) Contact Us
TechGenix Ltd is an online media company which sets the standard for providing free high quality technical content to IT professionals. (http://www.techgenix.com)
Advertise With Us
WindowSecurity.com is in no way affiliated with Microsoft Corp. Copyright 2014, TechGenix Ltd (http://www.techgenix.com/). All rights reserved. Please read our Privacy Policy (/pages/privacy.html) and Terms & Conditions (/pages/terms.html).
5 of 5
3/10/2014 4:52 PM