The Mindset
The registry is a hierarchical database storing settings for the OS, applications, users, and hardware. For a pentester it’s valuable for three reasons:- Persistence — autostart keys (
Run,RunOnce, services) that launch programs at boot or logon - Stored credentials — autologon passwords, saved VNC/PuTTY/SNMP secrets, sometimes plaintext
- Configuration intel — installed software, security settings, what’s enabled and what isn’t
Structure — Hives, Keys, and Values
The registry is organized into hives (top-level roots), which contain keys (like folders), which contain values (the actual data).The Five Root Hives
Value Types
Each value has a data type. The ones you’ll encounter:Querying the Registry
reg query — From CMD
From PowerShell
Persistence Keys — Where Autostart Lives
These keys launch programs automatically. Attackers plant entries here for persistence; you check them to find both attacker footholds and escalation opportunities (a writable autostart entry that runs as admin).The Run Keys
Other Autostart Locations Worth Checking
Stored Credentials in the Registry
The registry sometimes holds credentials in cleartext or weakly protected — a direct pillaging win.The SAM, SYSTEM, and SECURITY Hives
The most sensitive registry hives are stored as files on disk and hold the local password hashes. Reading them is a primary credential-theft technique (requires admin orSeBackupPrivilege).
Next: Windows Pillaging — automated enumeration, hunting sensitive files, and the data-exfiltration endgame.