Windows Data Discovery and Staging
Before transferring data out of a target environment, identify what is worth taking and stage it efficiently. Broad searches are slow and noisy: focus on high-value locations first, then compress and package before any transfer attempt. Prioritise these locations before running any broad recursive search:
SSH keys for pivoting to other hosts without a password
Cloud credential files (.aws, .azure, .gcloud) with wide IAM permissions
KeePass databases (.kdbx) containing full credential stores
VPN and RDP configs revealing hosts not visible from your current position
Target these first, then expand to broader file searches.
High-value file locations
Searching file content for credentials
Content-based searches read more files from disk than path-based searches. They are noisier and slower, but they catch credentials stored in unexpected file types. The Select-String output shows the path, line number, and matching line. Check the Line column for the actual credential value rather than just confirming the pattern matched. Recently modified files reveal what was actively written during the engagement window. Use findstr on large directory trees: it runs faster than Get-ChildItem with Select-String on filesystems with many files. If EDR flags file reads, copy the target directory to a temp location and search the copy. Web application config files under C:\inetpub are especially valuable: they routinely contain database connection strings with plaintext credentials.
ShareFinder: network share enumeration
In domain environments, shares on other hosts often contain scripts, deployment files, and sensitive documents. PowerView's ShareFinder maps all accessible shares across the domain. SYSVOL and NETLOGON are always worth checking manually: Group Policy scripts frequently hardcode credentials and UNC paths to deployment resources. Look for non-default share names such as IT, Backup, Deploy, or Files. Those shares rarely have strict access controls applied. Find-DomainShare connects to every reachable host and generates significant network noise: use it early in an engagement or accept the detection risk. If PowerView is unavailable or blocked, use the manual net view approach for targeted checks against specific hosts.
Staging and compressing
Collect target files into a staging directory, then compress into a single archive. Smaller archives transfer faster and generate fewer network events than many individual file transfers. Use C:\Windows\Temp or C:\ProgramData as staging locations: both are writable by low-privilege users by default. Avoid staging inside user profile directories. Those paths are frequently monitored by EDR and included in backup jobs, which increases the chance of detection and data leakage to backup systems. Check the archive size before starting any transfer. Compress-Archive produces standard ZIP format, which any modern Windows host can open without additional tools installed.
For large archives consider splitting into parts: Compress-Archive does not support split archives natively but 7-Zip does if available on the target. Keep individual transfer sizes under 50MB where possible to reduce the chance of incomplete transfers and connection timeouts. When 7-Zip is not present, transfer files from the staging directory one at a time using your existing exfiltration channel. Delete the staging directory and archive immediately after a successful transfer. File creation events in monitored paths get logged: removing artifacts quickly reduces the detection window. If Compress-Archive is blocked by endpoint controls, certutil -encode produces a base64-encoded copy suitable for text-based exfiltration channels.