Windows Credential Hunting
File System Searches for Credentials
# Recursively search for files with "pass" in the name or ending in ".config"
dir /s /b *pass* == *.config
# Search for the word "password" in common configuration files
findstr /si password *.xml *.ini *.txt *.config *.conf
findstr /si credential *.xml *.ini *.txt *.config *.conf
# More targeted search for credentials in specific directories
findstr /spin "password" C:\Users\*.txt C:\Users\*.ini C:\Users\*.xml
findstr /spin "password" C:\inetpub\*.config C:\Program Files\*.config
# Find common configuration files that might contain credentials
dir /s /b web.config
dir /s /b php.ini
dir /s /b wp-config.php
dir /s /b *credential*
# Find all files containing the word "password" across the entire drive (be patient)
findstr /spin /c:"password" C:\*.* 2>nulUnattended Windows Installations
Extracting SAM and SYSTEM Hives
SAM/SYSTEM File Locations
Copying SAM and SYSTEM Files
Method 1: Using Volume Shadow Copy (requires admin privileges)
Method 2: Using reg save (requires admin privileges)
Method 3: Using Backup Privileges (SeBackupPrivilege)
Extracting Hashes from SAM/SYSTEM
Example Scenario
PowerShell History
Saved Windows Credentials
IIS Configuration Files
Credentials in Software Configurations
PuTTY
WinSCP
Remote Desktop Credentials
Credentials in Registry
Credentials Manager
Browser Stored Credentials
Configuration Files
Real-World Examples
Example 1: PowerShell History
Example 2: IIS Web.config
Example 3: Using Saved Credentials
Example 4: PuTTY Saved Session
Automated Credential Hunting Tools
Password Dumping Tools
PWDump and Variants
Impacket Tools
Metasploit Modules
Cracking the Hashes
OSCP Notes on Password Dumping
Pass-the-Hash (PtH) Attacks
Understanding Pass-the-Hash
Tools for Pass-the-Hash
LM and NTLM Hashes Format
OSCP Exam Tips
Real-World Example
Defense Against Pass-the-Hash
Automated Credential Hunting Tools
Password Dumping Tools
PWDump and Variants
Impacket Tools
Metasploit Modules
Cracking the Hashes
OSCP Notes on Password Dumping
Countermeasures
Last updated