The Windows Registry tells an intruder which remote access tools a user has configured, which servers they connect to, whether an autologon password is sitting in plain text and which security products are installed, and reading it takes no special privilege for most of those answers. MITRE ATT&CK tracks this as T1012 Query Registry, a Discovery technique on Windows. Registry reads happen millions of times a day on every host, so the technique cannot be blocked and is hard to see without the right telemetry. This guide is for detection engineers, SOC analysts and Windows administrators. It focuses on the registry locations attackers read for credentials and connection history (PuTTY, WinSCP, VNC, RDP client history and Winlogon autologon) and for security configuration, explains why common Sysmon configurations miss registry reads, and sets out how to detect and reduce the exposure.
Key takeaways
- Most telemetry records writes, not reads. Sysmon registry events cover key creation, deletion, value set and rename; seeing a read needs a SACL with Audit Registry (event 4663), EDR registry telemetry, or the command line of the tool doing the reading.
- A few keys carry most of the risk. Winlogon autologon values, saved session keys for SSH, SFTP and VNC clients, RDP client server history and security product keys are where targeted reads concentrate.
- Autologon is a plain text password. Microsoft states the Winlogon DefaultPassword is stored in plain text and that the key can be read remotely by Authenticated Users.
- Real groups do this. Volt Typhoon enumerated stored PuTTY sessions, Operation Wocao queried PuTTY session keys, and Chimera read RDP client server history from remote hosts.
- Cleaning the registry beats watching it. Removing stored passwords and connection secrets, then auditing the few keys that must remain, is cheaper than broad registry auditing.
What T1012 covers in ATT&CK v20
ATT&CK v20 (technique version 1.3) describes Query Registry as interacting with the Windows Registry to gather information about the system, configuration and installed software, often with the Reg utility (S0075) though other means exist, and using the result during automated discovery to shape follow-on behaviour. The platform is Windows only. There are no sub-techniques and no listed mitigations.
Two neighbouring techniques have their own pages and should not be confused with it: Credentials in Registry (T1552.002), where the goal is extracting a stored secret, and Modify Registry (T1112), where values are changed. T1012 is the read and discovery step that usually comes first. Security Software Discovery (T1518.001) also names reg query as a common method. For credential extraction depth see the MITRE ATT&CK T1552 Unsecured Credentials Guide; for registry changes see MITRE ATT&CK T1112 Modify Registry.
High-value registry locations attackers read
The table lists locations that appear in ATT&CK procedure examples or vendor documentation, what they reveal and the owner of the fix. It is a monitoring and clean-up list, not an exhaustive one.
| Location | What it reveals | Source | Fix |
|---|---|---|---|
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon (AutoAdminLogon, DefaultUserName, DefaultPassword, DefaultDomainName) | A plain text password and the account it belongs to when autologon is configured this way | Microsoft Learn autologon article | Remove autologon or use a non-privileged kiosk account; never a domain or admin account |
HKCU\Software\SimonTatham\PuTTY\Sessions and SshHostKeys | Saved SSH session names, hostnames and usernames, and hosts the user has connected to; PuTTY does not store passwords | PuTTY FAQ; Operation Wocao and Volt Typhoon examples | Accept as a map of targets; protect SSH keys and limit admin SSH from workstations |
| WinSCP saved sessions | Hosts, usernames and, unless a master password is set, saved passwords that WinSCP says can easily be recovered | WinSCP documentation | Turn off password saving or require a master password by policy |
| VNC server and viewer keys | Whether VNC is installed and its configuration; Lazarus Group malware checked HKCU and HKLM for SecureCRT, Terminal Services, RealVNC and TightVNC | ATT&CK v20 procedure example | Remove unmanaged VNC; use authenticated remote access through a gateway |
HKCU\Software\Microsoft\Terminal Server Client\Servers and \Default | RDP servers the user has connected to, with saved usernames | ATT&CK v20: Chimera (queried remotely per user SID), BabyShark | Accept as target map; enforce MFA and restricted admin paths for RDP |
Security product keys (for example HKCU\Software\KasperskyLab) | Which security tools are present, so malware can adapt or exit | ATT&CK v20: LiteDuke; Stuxnet searched the registry for security programs | Tamper protection; treat reads by unknown processes as suspicious |
Office security keys (for example Excel Security\AccessVBOM) | Whether macro and VBA project access protections are on | ATT&CK v20: Cobalt Strike | Enforce settings by policy so a local value cannot weaken them |
Internet Settings ProxyServer | Proxy to route command and control through | ATT&CK v20: FunnyDream, Sibot, ZIRCONIUM | Low value to hide; detect odd readers instead |
Related but distinct: reading HKLM\SECURITY\Policy\Secrets needs SYSTEM and is LSA Secrets (T1003.004), and saving the SAM, SYSTEM and SECURITY hives, as ATT&CK records for Daggerfly, is Security Account Manager dumping (T1003.002). Both are credential access, not discovery, and should alert on sight. See the T1003 OS Credential Dumping guide.
How adversaries use registry queries
- Finding the next hop: CISA's Volt Typhoon advisory (AA24-038A) lists
reg queryamong the group's living off the land tools and records enumeration of stored PuTTY sessions; ATT&CK v20 records Volt Typhoon querying installed software including PuTTY. During Operation Wocao the actors queried the per-user PuTTY Sessions key to find recent SSH sessions. - Remote harvesting across hosts: Chimera queried the Terminal Server Client Servers key on remote hosts under each user's SID, building a map of RDP targets without running code on each machine.
- Environment checks before payload: TEARDROP checked a registry key existed before decoding its payload, and BlackByte read language settings; these checks decide whether the malware proceeds.
- Software inventory for targeting: APT38 ran Node.js malware that queried the registry for installed software, and Dtrack collected RegisteredOwner, RegisteredOrganization and InstallDate values.
- Offline hive access: Fox Kitten accessed the ntuser.dat and UserClass.dat hives (per CISA AA20-259A), which avoids live registry APIs entirely.
What to detect and where
ATT&CK v20 detection strategy DET0209, "Detection of Registry Query for Environmental Discovery", has one Windows analytic (AN0589): registry read access by suspicious or non-interactive processes querying system configuration, installed software or security settings. It names Process Creation (Sysmon event 1), Windows Registry Key Modification (Sysmon events 13 and 14) and Command Execution (PowerShell events 4103 to 4106).
The read visibility gap
Microsoft's Sysmon documentation defines its registry events as key and value create and delete (12), value set (13) and rename (14). None records a read, so a typical Sysmon deployment sees reg.exe query through its command line but not an implant calling the registry API directly. To see reads you need one of:
| Source | What it shows | Cost and limits |
|---|---|---|
| Process creation with command line (4688 or Sysmon 1) | reg.exe query, reg save and PowerShell registry provider use when launched as a process | Cheap; blind to in-process API reads |
| PowerShell script block logging (4104) | Get-ItemProperty and registry provider paths inside scripts | Cheap; PowerShell only |
| Audit Registry with SACLs (4656, 4663) | Each access to a key with a matching SACL, including reads by any process, with the account and process name | Events only for keys with a SACL; Microsoft advises defining SACLs carefully and enabling on critical computers first to avoid flooding the log |
| EDR registry telemetry | Registry reads by process, depending on product and policy | Product dependent; many products sample or filter reads |
| Remote Registry service and network logs | Remote reads over the winreg named pipe, as in the Chimera case | Requires SMB and named pipe visibility |
Detection logic that holds up
- Targeted key reads by unusual processes: put read SACLs on the small set of keys in the table above (Winlogon, PuTTY Sessions, WinSCP sessions, VNC keys, Terminal Server Client) on pilot hosts, and alert on event 4663 where the process is not the owning application, Explorer, backup or management agents.
- reg.exe from odd parents:
reg.exe queryspawned by web servers, database servers, Office applications, script hosts or remote shells, especially with search switches for strings such as "password". - Remote registry fan-out: one workstation opening the winreg pipe on many hosts, or the Remote Registry service starting on hosts where it is normally stopped.
- Read then use: a read of PuTTY, WinSCP or RDP history keys followed within the hour by new SSH, SFTP or RDP connections from that host to hosts it has not contacted before.
- Hive saves:
reg saveof SAM, SYSTEM or SECURITY, or copying ntuser.dat, outside backup tooling. High fidelity, escalate as credential access.
Baselining
Inventory, patch, backup and EDR agents read the registry constantly. Allow list by signer and install path, scope SACLs narrowly so the volume stays low, and review the allow list when agents change. CISA's Volt Typhoon guidance to baseline installed tools and account behaviour applies directly: a remote shell running reg.exe on a domain controller should never look normal. See the Windows Event Log Guide and Windows Event Forwarding Guide for collection.
Reducing what the registry gives away
ATT&CK v20 maps no mitigation to T1012. The steps below are NHI Mgmt Group recommendations, ordered by value.
- Find and remove plain text autologon passwords. Query the Winlogon DefaultPassword value across the estate with your management tool (read only), then remove it or move devices to a dedicated, non-privileged kiosk account. Microsoft recommends autologon only where the computer is physically secured and untrusted users cannot remotely access the registry.
- Stop client tools saving passwords. Set WinSCP to require a master password or disable password saving by policy, and move SSH users to key-based or certificate-based authentication with keys protected by a passphrase or hardware token. The PuTTY FAQ recommends public key authentication rather than remembered passwords.
- Remove unmanaged remote access software. VNC and similar tools installed outside IT control both store configuration in the registry and provide an access path.
- Restrict remote registry access. Keep the Remote Registry service disabled where it is not needed and limit who can connect to the winreg pipe, which also limits the remote read Microsoft warns about for the Winlogon key.
- Protect local admin and service credentials. Use Windows LAPS for local administrator passwords and gMSAs for services instead of storing service passwords anywhere readable.
- Audit the keys that must remain. Add read SACLs to the short list of sensitive keys rather than auditing the whole registry.
Where identity fits
Many secrets found in the registry are non-human or shared credentials: kiosk and autologon accounts, SFTP accounts used for file transfers to partners, and VNC passwords shared by a support team. They rarely have owners or rotation schedules, which is why they survive in the registry for years. Treat each one found as an identity to inventory, own and replace with a managed alternative. See the Service Account Security Guide.
How to test your coverage
- Telemetry check: confirm command line logging, PowerShell 4104 and, on a pilot ring, Audit Registry events for SACL-protected keys reach the SIEM.
- Emulate in an authorised test: read the test values in each sensitive key three ways:
reg.exe, PowerShell and a compiled test program calling the registry API. Record which produce an alert. - Emulate remote reads from a test workstation against two servers and confirm the fan-out rule.
- Measure volume for two weeks in alert-only mode, then tune by signer and path.
- Rollback: SACLs can be removed by the same Group Policy that set them; keep them in a dedicated GPO.
Metrics
- Autologon exposure: number of hosts with a Winlogon DefaultPassword value (target zero outside approved kiosks).
- Stored client passwords: number of hosts with WinSCP saved passwords without a master password, trending to zero.
- Read coverage: of the three read routes in testing, how many raise an alert for each sensitive key.
- SACL coverage: percentage of tier 0 and tier 1 servers with read SACLs on the sensitive key list.
- Noise: T1012 alerts per 1,000 hosts per week after tuning and the share closed as benign.
Common failure patterns
- Relying on Sysmon for reads. Teams map T1012 as covered because Sysmon registry events are on, but those events record changes, not reads.
- Auditing the whole registry. Broad SACLs flood the Security log, which Microsoft warns against, and the auditing is switched off.
- Leaving autologon on servers. Build and lab servers keep a domain account in the Winlogon key long after setup, readable remotely by Authenticated Users.
- Searching only for "password". Rules match string searches but miss targeted reads of known keys such as PuTTY Sessions or Terminal Server Client, which is what Volt Typhoon, Operation Wocao and Chimera did.
- No follow-through after detection. A confirmed read of saved session keys is closed without checking for new connections to the listed hosts or rotating the credentials found there.
Framework mapping
| Framework | Reference | How it applies |
|---|---|---|
| MITRE ATT&CK v20 | T1012 Query Registry; detection strategy DET0209 | Technique and analytic in this guide |
| NIST CSF 2.0 | DE.CM-09; PR.PS-01; PR.DS-01 | Monitoring endpoints; configuration management; protecting data at rest, including stored credentials |
| NIST SP 800-53 Rev 5 | AU-12 Audit Record Generation; SI-4 System Monitoring; CM-6 Configuration Settings; IA-5 Authenticator Management; SC-28 Protection of Information at Rest | SACL auditing, detection, removing autologon and stored passwords |
| CIS Controls v8.1 | Control 4 Secure Configuration; Control 8 Audit Log Management | Configuration baseline for autologon and client tools; logging |
| ISO/IEC 27001:2022 Annex A | A.8.9 Configuration management; A.5.17 Authentication information; A.8.15 Logging | Hardening, protecting stored secrets, logging |
Practitioner checklist
- Scan the estate read-only for Winlogon DefaultPassword values and remove them.
- Enforce WinSCP master password or disable password saving; move SSH to keys or certificates.
- Remove unmanaged VNC and remote access tools.
- Disable Remote Registry where not required and monitor winreg pipe access.
- Enable Audit Registry and add read SACLs only to the sensitive key list, starting with tier 0 and tier 1 servers.
- Alert on
reg.exefrom unusual parents and on hive saves outside backup tools. - Correlate reads of session history keys with new outbound SSH, SFTP or RDP connections.
- Record ATT&CK coverage for T1012 as partial unless read telemetry exists.
- Rotate any credential found in the registry and assign it an owner.
Standards and references
- MITRE ATT&CK: T1012 Query Registry
- MITRE ATT&CK: T1552.002 Credentials in Registry
- CISA: AA24-038A PRC State-Sponsored Actors Compromise and Maintain Persistent Access to U.S. Critical Infrastructure
- Microsoft Learn: Configure Windows to automate logon
- Microsoft Learn: Audit Registry
- Microsoft Learn: Sysmon
- PuTTY: Frequently Asked Questions
- WinSCP: Securing credentials
Related NHI Mgmt Group resources: Living off the Land Guide · Sysmon Guide · ATT&CK Credential Access Tactic Guide · ATT&CK Detection Strategies and Analytics Guide