T1012 Sumo Logic CSE · Sumo

Detect Query Registry in Sumo Logic CSE

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/

Sumo Detection Query

Sumo Logic CSE (Sumo)
sql
_sourceCategory="windows/sysmon" EventCode=1
| parse regex field=Image "(?i)(?<process_name>[^\\]+\.exe)$"
| parse regex field=CommandLine "(?i)(?<target_key>(?:HKLM|HKCU|HKEY_LOCAL_MACHINE|HKEY_CURRENT_USER|HKEY_USERS|HKU|HKCR|HKEY_CLASSES_ROOT)[\\/][^\s]+)" nodrop
| eval is_reg_exe = if(matches(Image, "(?i)\\reg\.exe$") and matches(CommandLine, "(?i)(\squery\s|\sexport\s|\ssave\s)"), 1, 0)
| eval is_ps_reg = if(
    matches(Image, "(?i)(powershell|pwsh)\.exe$")
    and matches(CommandLine, "(?i)(HKLM:|HKCU:|HKEY_LOCAL_MACHINE|HKEY_CURRENT_USER|Registry::)")
    and matches(CommandLine, "(?i)(Get-Item|Get-ItemProperty|Get-ChildItem|Get-ItemPropertyValue)"),
    1, 0
)
| where is_reg_exe = 1 or is_ps_reg = 1
| eval sensitive_path = if(
    matches(CommandLine, "(?i)(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)"),
    1, 0
)
| eval recursive_query = if(matches(CommandLine, "(?i)(\s/s\b|\s-s\b|-Recurse)"), 1, 0)
| eval suspicious_parent = if(
    matches(ParentImage, "(?i)(wscript|cscript|mshta|wmic|rundll32|regsvr32|msbuild|installutil|excel|winword|outlook|powerpnt)\.exe$"),
    1, 0
)
| where sensitive_path = 1 or suspicious_parent = 1 or recursive_query = 1
| eval query_type = if(is_reg_exe = 1, "reg.exe", "PowerShell")
| fields _messageTime, Computer, User, Image, CommandLine, ParentImage, ParentCommandLine, target_key, query_type, sensitive_path, recursive_query, suspicious_parent
| sort by _messageTime desc
medium severity high confidence

Sumo Logic detection for T1012 Query Registry using Sysmon process creation events (EventCode 1). Identifies reg.exe and PowerShell registry enumeration targeting sensitive registry paths used by threat actors to fingerprint targets, locate credentials, and identify security products. Enriches events with flags for sensitive path access, recursive enumeration, and execution from suspicious parent processes.

Data Sources

Sumo Logic Cloud SIEMSysmon (Windows Event Forwarding to Sumo Logic)Sumo Logic Installed Collector on Windows endpoints

Required Tables

_sourceCategory=windows/sysmon

False Positives & Tuning

  • Endpoint detection and response (EDR) agents performing periodic registry baseline scans as part of file integrity monitoring or behavioral telemetry collection
  • Software deployment tools such as PDQ Deploy, Chocolatey, or WinGet querying CurrentVersion\Uninstall or Run keys during install/uninstall operations
  • PowerShell DSC (Desired State Configuration) scripts checking registry state to enforce compliance baselines in managed enterprise environments
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