Your PC or Laptop is also not secure from such attacks. While you may reiterate that I have password protected it, but that’s not enough today, as we will see.
The Hackers USB Drive
To the layman, it might seem that some revolutionary new technology is at work, but in reality it’s nothing more than some software trickery. But in this day & age, with Windows advanced so much with 10, how is this even be possible? To understand that we need to learn how Windows account security works.
The Weak Part: Windows Account Security
From a very long time, Window’s way of storing user account password has been criticized. Windows stores all the user account passwords in a SAM(Security Account Manager) database file. For obvious reasons the passwords are not stored as plain text and the file is inaccessible when the OS running. Hashing, a one way function, is used to convert your password into a string of characters of fixed length so that in case someone grabs the SAM file(which is easier than you think), the passwords cannot be known. The hashing methods used by Windows are the reason of criticism. These methods are explained below.
LM Hashing & NTLM Hashing
LM hashing is a very old method of Windows 95-era and is not used today. In this method the password is converted into hash using the step-by-step method shown below. The inherent process of breaking down your password in two 7-character strings, made LM hashing vulnerable to brute force attacks. This was improved by the NTLM method which used the more complex MD4 hashing technique. While this solved the earlier problem it was still not secure enough because of Rainbow Tables.
Rainbow Tables
Till now we learnt what hashing is and it’s one important property is that it’s one-way. Which means brute forcing a hash will not yield the original password back. So this is where rainbow tables come into picture. A Rainbow Table is a literal table which contains pre-generated hashes for all possible password combinations for a given hash function. For example if a password has a rule that it can consist of 7 characters from 26 alphabets & 10 numbers 0-9 only, then through permutations we have 42072307200!! possible combinations for it. A rainbow table for this function will contain hashes & the corresponding password for every possible combination. But the downside of rainbow tables is that they get very big when the input size & password length increases. As shown above, a simple rainbow table for LM hashing function of Windows XP is 7.5 GB in size. Tables of modern hash functions which use alphabets, numbers & symbols can be of multi hundred gigabytes. So these are not easy to process and use for a normal user with a desktop PC. So someone who has a Windows SAM file can run a lookup for the hash in a pre-computed table and find the password(if it’s relatively simple). And this is possible because of one drawback of NTLM hashing method of not using salting. Salting is a technique of adding random string of characters to the password before hashing, so that each hash becomes unique, as shown above, defeating the purpose of Rainbow Tables.
The Attack: How It Is Executed
In Windows 10, Microsoft is using NTLMv2 hashing technique, which while doesn’t use salting but fixes some other critical flaws and overall offers more security. But then also you are not cent percent protected, as I will show now how can you perform a similar attack on your own PC.
Recovering your Hashes
First step is to get hashes of your password using any one of the several methods available. I am going to use the freely available Hash Suite 3.4 (formerly known as pwdump). The beauty of this program is that it can grab the hashes even when Windows is running, so you don’t have to mess around with bootable USB drives. Windows Defender may get nauseous while this is running, so turn it off momentarily. Step 1: Download the free version of Hash Suite from here and extract all the contents of the zip file to a folder. Step 2: Open the folder and launch the program by selecting Hash_Suite_64 for 64-bit OS or Hash_Suite_32 for 32-bit one. Step 3: To import hashes click on Import > Local Accounts as shown below. This will load the hashes of all the accounts present on the PC.
Cracking the Hashes
From here on, Hash Suite also provides option for cracking the hashes using dictionary & brute force attacks but those are available only in paid version. So instead we use one of the online services to crack our hashes. Crackstation & OnlineHashCrack are the two sites which I used for the purpose. These sites use combination of pre-calculated tables, dictionary attacks and brute force to crack your hashes. In my case Crackstation immediately conveyed that it can’t match the hash & OnlineHashCrack took five days time but still couldn’t crack it. Apart from them, there other offline programs such Cain & Abel, JohnTheRipper, OphCrack and more which grab the hashes even over network. But explaining how to use them will turn this article into a BlackHat conference piece. Note: You can verify whether the hashes extracted by HashSuite are of your account’s password by matching it with the hash generated for your password using any online hash generators.
Your Defense
As we saw grabbing the hashes is so much simple that you don’t have to mess around with bootable drives or complex commands. And there are many other programs which are much more advanced in this regard. So in such case your best defense is password & encryption, which I have expanded in detail below.
Long Password
Starting with the length, a long password is generally considered more secure. But how long is long enough? Researchers say that your password should be at least 12 characters long. But to be on the safer side, a 16+ character password is recommended. And please don’t set it as password12345678. It should be mix of lowercase, uppercase alphabets, numbers & symbols.
Using Encryption
Second line of defense is using encryption. In Windows the encryption key is associated with your Windows Account Password, so even if someone resets the password like in Linus’s video, your stuff will not be accessible. You can use either the inbuilt encryption if you have Pro version of Windows or use any of the third party programs.
Using SYSKEY & Microsoft Account
To prevent unauthorized access, the Windows SAM is stored in an encrypted format. And the encryption key is stored locally on the PC. SYSKEY is an in built Windows utility which allows you move that key to an external media(USB drive) or add one more layer of password before the login. You can learn more about how to set it up here. Additionally you can also switch to Microsoft account, as the PRK does not work on Microsoft account, as stated by Linus in the video . But I could not verify that as I did not have a PRK to test. But HashSuite was able to extract the Hashes of my Microsoft account’s password, so it is not that effective.
Other Miscellaneous Measures
Apart from the above, you can also set a BIOS password which will add another layer of protection. Also if you don’t like encrypting your whole Windows drive you can set a separate partition which holds all your important stuff, so even if a hacker resets the password, you do not completely lose access to your files. Using any biometric method of login is one more way to thwart such attacks. Last but not the least, upgrading to Windows 10 is also one way even if it seems little bizarre. Even though it’s vulnerable, it has other security improvements like Windows Hello & Credential Guard.
In Panic Mode? Don’t Be
If you have read the whole post(brave you!) you might be panicky. But there’s one important thing we are over looking here, all this attacks require physical access to your PC. While these attacks are still possible over network, but executing them is not a cup of tea of someone who has learnt hacking from Hacker in a Week type videos. But one should be careful as we always have around some pissed off people (or colleagues) looking to do harm. And I again reiterate, the method shown here is only for informational purposes. Don’t go trying it on someone else’s PC or try sniffing a public network for hashes. Both the things can land you in trouble. So stay safe & do share your thoughts & doubts through comments.