Windows Token and Credential Harvesting
After gaining access, credential and token collection is the highest-priority post-exploitation task. Credentials recovered here feed lateral movement, and tokens can give you immediate access to other user contexts without needing passwords at all.
Stored credentials — registry and files
AutoLogon credentials are stored in plaintext in the registry. These are the first place to check — they require no tools and are read with a single command.
AutoLogon passwords are frequently set on kiosk machines, jump boxes, and service accounts. If you find a DefaultPassword value, try it against every user on the target and against other services (password reuse is common). Stored cmdkey credentials can be used with runas /savecred — see Runas Stored Credentials.
PowerShell and command history
Configuration files with credentials
Web application configs, deployment files, and unattended install files frequently contain plaintext credentials. These sit on disk long after installation and are often overlooked.
LSASS memory dump
LSASS holds NTLM hashes and in older or misconfigured environments plaintext credentials for all interactively logged-in users. Dumping it requires SYSTEM or SeDebugPrivilege. Extract it locally on the target then analyse on your attack box with mimikatz or pypykatz.
SAM and SYSTEM hive dump
The SAM database holds NTLM hashes for all local accounts. It cannot be read while Windows is running because SYSTEM locks it, but you can copy the hive via reg save or shadow copy, then extract hashes offline.
Administrator:500:aad3b435b51404eeaad3b435b51404ee:8846f7eaee8fb117ad06bdd830b7586c::: Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: user1:1001:aad3b435b51404eeaad3b435b51404ee:2b576acbe6bcfda7294d6bd18041b8fe:::
NTLM hashes can be used directly for Pass-the-Hash without cracking. See Pass-the-Hash and Pass-the-Ticket for how to use them. For cracking, see Windows Password Attacks.
Windows Credential Manager and DPAPI
DPAPI-encrypted credentials require master key decryption. For the full workflow including SharpDPAPI and browser password extraction see DPAPI Credential Decryption.
Browser saved credentials
Chrome and Edge credential databases are SQLite files encrypted with DPAPI. Transfer the Login Data file and the Local State file from the same directory to your attack box and use a tool like HackBrowserData or parse with Python and a DPAPI decryption library. The DPAPI decryption is user-context-bound so the extraction is most reliable when running as the target user.
For all the recovered hashes and credentials the next step is lateral movement. See Pass-the-Hash and Pass-the-Ticket and PsExec and SMB Lateral Movement.
References
-
Impacket — GitHubgithub.com/fortra/impacket (opens in new tab)
secretsdump and other credential extraction utilities
-
pypykatz — GitHubgithub.com/skelsec/pypykatz (opens in new tab)
Python-based mimikatz implementation for parsing LSASS dumps
-
ProcDump — Sysinternalsdocs.microsoft.com/en-us/sysinternals/downloads/procdump (opens in new tab)
Legitimate process dump utility, less likely to trigger AV
Was this helpful?
Your feedback helps improve this page.