T1012 Elastic Security · Elastic

Detect Query Registry in Elastic Security

Adversaries may interact with the Windows Registry to gather information about the system, configuration, and installed software. The Registry contains a significant amount of information about the operating system, configuration, software, and security. Information can easily be queried using the Reg utility, though other means to access the Registry exist. Some of the information may help adversaries to further their operation within a network. Adversaries may use the information from Query Registry during automated discovery to shape follow-on behaviors, including whether or not the adversary fully infects the target and/or attempts specific actions. Threat actors including Turla (Epic), APT41 (DUSTTRAP), NOBELIUM (Sibot), Sandworm (TEARDROP), Lazarus (HOPLIGHT), Lyceum (Shark), and numerous commodity malware families leverage registry queries to fingerprint targets, locate credentials, identify installed security products, and discover network proxy configurations.

MITRE ATT&CK

Tactic
Discovery
Technique
T1012 Query Registry
Canonical reference
https://attack.mitre.org/techniques/T1012/

Elastic Detection Query

Elastic Security (Elastic)
eql
sequence by host.id with maxspan=5m
  [process where event.type == "start" and
   (
     (process.name : "reg.exe" and process.args : ("query", "export", "save") and
      process.command_line : ("*Windows NT\\CurrentVersion*", "*HARDWARE\\DESCRIPTION\\System*", "*CurrentVersion\\Uninstall*", "*Microsoft\\Cryptography*", "*CurrentControlSet\\Services*", "*CurrentControlSet\\Control\\Lsa*", "*SimonTatham\\PuTTY*", "*OpenSSH\\Agent*", "*Internet Settings*", "*Terminal Server*", "*Software\\Policies*", "*Bitcoin*", "*Image File Execution Options*", "*Classes\\http\\shell*", "*CurrentVersion\\Run*", "*WinSCP\\Sessions*"))
     or
     (process.name : ("powershell.exe", "pwsh.exe") and
      process.command_line : ("*HKLM:*", "*HKCU:*", "*HKEY_LOCAL_MACHINE*", "*HKEY_CURRENT_USER*", "*Registry::*") and
      process.command_line : ("*Get-Item*", "*Get-ItemProperty*", "*Get-ChildItem*", "*Get-ItemPropertyValue*"))
   ) and
   (
     process.command_line : ("*Windows NT\\CurrentVersion*", "*HARDWARE\\DESCRIPTION\\System*", "*CurrentVersion\\Uninstall*", "*Microsoft\\Cryptography*", "*CurrentControlSet\\Services*", "*CurrentControlSet\\Control\\Lsa*", "*SimonTatham\\PuTTY*", "*OpenSSH\\Agent*", "*Internet Settings*", "*Terminal Server*", "*Software\\Policies*", "*Bitcoin*", "*Image File Execution Options*", "*Classes\\http\\shell*", "*CurrentVersion\\Run*", "*WinSCP\\Sessions*")
     or process.parent.name : ("wscript.exe", "cscript.exe", "mshta.exe", "wmic.exe", "rundll32.exe", "regsvr32.exe", "msbuild.exe", "installutil.exe", "excel.exe", "winword.exe", "outlook.exe", "powerpnt.exe")
     or process.command_line : ("* /s*", "* -s *", "*-Recurse*")
   )
  ]
medium severity high confidence

Detects T1012 Query Registry activity via reg.exe or PowerShell targeting sensitive registry paths associated with credentials, persistence, installed software, and security configuration. Covers both direct reg.exe query/export/save operations and PowerShell Get-Item/Get-ItemProperty enumeration. Flags recursive queries, suspicious parent processes (Office apps, script engines, LOLBins), and access to high-value keys used by threat actors including Turla, APT41, NOBELIUM, and Lazarus.

Data Sources

Elastic Endpoint SecurityWinlogbeat with SysmonElastic Agent (endpoint integration)

Required Tables

logs-endpoint.events.process-*winlogbeat-*

False Positives & Tuning

  • Legitimate IT administration scripts querying registry for inventory or configuration management (e.g., SCCM, Ansible, Puppet)
  • Software installers and uninstallers querying CurrentVersion\Uninstall to check for existing installations or perform cleanup
  • Security tools such as vulnerability scanners, EDR agents, or SIEM forwarders enumerating registry keys as part of baseline collection
Download portable Sigma rule (.yml)

Other platforms for T1012


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Registry Query for OS Version and Hardware Information

    Expected signal: Sysmon Event ID 1: Multiple Process Create events with Image=reg.exe, CommandLine containing 'query' and 'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion' and 'HKLM\HARDWARE\DESCRIPTION\System'. Security Event ID 4688 with identical command line details if command line auditing is enabled. Prefetch entry updated at C:\Windows\Prefetch\REG.EXE-*.pf with current timestamp.

  2. Test 2Recursive Registry Query for Installed Software

    Expected signal: Sysmon Event ID 1: Two Process Create events for reg.exe — one per command — with CommandLine containing 'query', 'Uninstall', and '/s' flag. The recursive query generates a large stdout output but only one process creation event per reg.exe invocation. Security Event ID 4688 with command line if auditing enabled.

  3. Test 3PowerShell Registry Query for Proxy Configuration

    Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Get-ItemProperty', 'HKCU:', and 'Internet Settings'. PowerShell ScriptBlock Log Event ID 4104 from Microsoft-Windows-PowerShell/Operational with the full command content. Note: read-only registry access does not generate Sysmon Event IDs 12/13/14 — process-level telemetry is the primary detection source.

  4. Test 4Registry Query for Machine GUID and LSA Configuration

    Expected signal: Sysmon Event ID 1: Three sequential Process Create events for reg.exe with CommandLine targeting 'Cryptography', 'Control\Lsa' keys respectively. Security Event ID 4688 with command line if auditing enabled. Consecutive execution timestamps within milliseconds of each other, consistent with scripted automated enumeration rather than manual administrative queries.

Unlock Pro Content

Get the full detection package for T1012 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections