Hunting (Windows)
CPTS Notes
- Foundations
- Enumeration with Nmap
- Passwords
- Wordlists
- Cracking
- Protected Files
- Spraying and Defaults
- Hunting (Windows)
- Hunting (Linux)
- Hunting (Shares)
- Hunting (Traffic)
- Looting (Windows)
- Looting (Linux)
- File Services
- FTP
- SMB
- NFS
- Rsync
- Network
- DNS
- SNMP
- SMTP
- Mail Retrieval
- Cloud Mail
- Databases
- MySQL
- MSSQL
- Remote Access
- SSH
- R-Services
- RDP
- WinRM
- WMI
- Linux
- Reading Files
- Editing Files
- Searching Files
- Requests and Transfer
- Local Enumeration
- Privesc Primer
- File Transfer
- Choosing a Method
- Serving Files
- Windows Transfers
- Linux Transfers
- Code One-Liners
- Session Transfers
- Protected Transfers
- Detection & Evasion
- Windows
- Reading Files
- Editing Files
- Searching Files
- Requests and Transfer
- Local Enumeration
- Privesc Primer
- Reference
- Port References
- DNS Resolution
- The Mail Pipeline
- SMB & NetBIOS
TL;DR
Users and apps leave passwords in plain files, config, and insecure credential stores. Hunting is searching the host for them by keyword. Dumping the credential stores is the sibling job in Looting (Windows).
Base the search on what the box is for. An IT admin’s workstation holds connection configs and saved sessions a kiosk never would, so the machine’s role tells you where to look.
What to search for
The same handful of terms surface most credentials:
password passwd pwd cred credential keyuser username login connectionString secretSearch the filesystem
findstr searches file contents across many types at once:
findstr /SIM /C:"password" *.txt *.ini *.cfg *.config *.xml *.ps1 *.yml/S recurses subdirectories, /I ignores case, /M prints only the filenames that match, and /C:
takes the search string. PowerShell does the same with native cmdlets:
Get-ChildItem -Recurse -Include *.txt,*.ini,*.config,*.xml,*.ps1 -ErrorAction SilentlyContinue | Select-String -Pattern "password"With a GUI session, Windows Search also indexes file contents and settings for a quick keyword pass.
Pull from apps with LaZagne
Browsers and sysadmin tools store credentials, often reversibly. LaZagne decrypts them from dozens of
applications. Transfer the standalone LaZagne.exe to the target, then run every module:
LaZagne.exe all # run all modulesLaZagne.exe all -vv # same, verbose, to see each app it checks| Module | Pulls from |
|---|---|
browsers |
Saved logins in Chromium, Firefox, Edge, and others |
sysadmin |
Config files for WinSCP, OpenVPN, and similar tools |
windows |
LSA secrets, Credential Manager, and cached creds |
mails |
Outlook and Thunderbird mailboxes |
wifi |
Saved WiFi passwords |
memory |
KeePass and LSASS in memory |
Browsers are the richest target: they store site logins reversibly for the logged-on user, so the
browsers module often returns plaintext.
High-value spots
Some locations pay off often enough to check on every host:
SYSVOLshare on a DC: GPPGroups.xmlwith acpassword, and credentials hardcoded in logon scripts. Decrypt thecpasswordwithgpp-decryptfrom SMB.unattend.xml,sysprep.xml, andweb.config: deployment and app files that keep service-account passwords.- AD description fields on user and computer objects, where admins sometimes park a password.
- KeePass databases (
.kdbx): crack the master password in Protected files, then every stored credential opens. - Named files such as
pass.txt,passwords.docx, andpasswords.xlsxon user profiles, shares, and SharePoint.
A credential found here often works on other hosts and services, so test every one across the network.