All right, we know that password hashes are stored in the registry, in the key HKLM/Security/Sam. Normally you must have administrator privileges to access it. Even you are the local admin – you still have to assign manually full control permission for this subkey to yourself. Then you may see something like this:
<a href="http://itsecuritylab.eu/wp-content/uploads/2010/07/image_011.jpg"></a>
The juicy stuff physically is stored in two files:
C:/windows/system32/config/sam
and
C:/windows/system32/config/system
<a href="http://itsecuritylab.eu/wp-content/uploads/2010/07/image_02.jpg"></a>
So theoretically if we would be able to get the content of those files we may pass it to Cain and play a little with it… But unfortunately those files are locked, so they can’t be copied or accesses by any way. If you will try, you will immediately have a nice error like this:
<a href="http://itsecuritylab.eu/wp-content/uploads/2010/07/image_03.jpg"></a>
If you don’t want to go to deep into the theory (which is recommended btw), - here is the practical solution.
We must have own separate copies of both files: C:/windows/system32/config/sam and C:/windows/system32/config/system in target system (the second one is needed because of the “boot key” is stored there) so then we may process it somewhere else with Cain & Abel.
Run the fdump.exe with the following parameters:
<a href="http://itsecuritylab.eu/wp-content/uploads/2010/07/image_04.jpg"></a>
Expected result:
<a href="http://itsecuritylab.eu/wp-content/uploads/2010/07/image_05.jpg"></a>
Run cain.exe and do the following thing: Select “Cracker”, then “Add to list” and then “Import hashes from Sam database”.
<a href="http://itsecuritylab.eu/wp-content/uploads/2010/07/image_06.jpg"></a>
Then:
<a href="http://itsecuritylab.eu/wp-content/uploads/2010/07/image_07.jpg"></a>
So after all manipulations it should looks more or less like this:
<a href="http://itsecuritylab.eu/wp-content/uploads/2010/07/image_08.jpg"></a>
Then click “Next”, and here we are!
<a href="http://itsecuritylab.eu/wp-content/uploads/2010/07/image_09.jpg"></a>
The rest is up to you. Now you probably need a good rainbow tables and a bit of luck. :-)
You may be tempted to explore the copied registry manually and see what else is there (your curiosity is more then normal), so here is the quick "how to" browse downloaded registry files with regedit:
Open regedit, and make single click on HKLM branch (important!):
<a href="http://itsecuritylab.eu/wp-content/uploads/2010/07/image_10.jpg"></a>
Then in the main menu select “File” and “Load Hive”, then select our file: C:/myfiles/sam
<a href="http://itsecuritylab.eu/wp-content/uploads/2010/07/image_11.jpg"></a>
...and finally provide a key name. This is the key where a new hive will be attached to.
<a href="http://itsecuritylab.eu/wp-content/uploads/2010/07/image_12.jpg"></a>
Do not forget to assign proper permissions to this branch:
<a href="http://itsecuritylab.eu/wp-content/uploads/2010/07/image_13.jpg"></a>
Close the regedit and open it again. Now you can browse everything! :)
<a href="http://itsecuritylab.eu/wp-content/uploads/2010/07/image_14.jpg"></a>