T1564.002 Microsoft Sentinel · KQL

Detect Hidden Users in Microsoft Sentinel

Adversaries may use hidden users to hide the presence of user accounts they create or modify. On Windows, accounts can be hidden from the login screen by setting a registry value under HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList with a DWORD value of 0 for the username. On macOS, adversaries can set a user's UID below 500 or set a UserShell property to /usr/bin/false to hide them. Threat actors including Dragonfly, Kimsuky, and SMOKEDHAM malware use hidden user accounts for persistent backdoor access.

MITRE ATT&CK

Tactic
Defense Evasion
Technique
T1564 Hide Artifacts
Sub-technique
T1564.002 Hidden Users
Canonical reference
https://attack.mitre.org/techniques/T1564/002/

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
DeviceRegistryEvents
| where Timestamp > ago(24h)
| where RegistryKey has "Winlogon\\SpecialAccounts\\UserList"
| where ActionType in ("RegistryValueSet", "RegistryKeyCreated")
| project Timestamp, DeviceName, AccountName, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc
union (
  DeviceProcessEvents
  | where Timestamp > ago(24h)
  | where FileName in~ ("net.exe", "net1.exe")
  | where ProcessCommandLine has "user" and ProcessCommandLine has "/add"
  | extend UserAdd = ProcessCommandLine has "/add"
  | extend ToAdmins = ProcessCommandLine has_any ("administrators", "admins")
  | project Timestamp, DeviceName, AccountName, ProcessCommandLine, InitiatingProcessFileName, UserAdd, ToAdmins
  | sort by Timestamp desc
)
high severity high confidence

Detects hidden user account creation via the Windows SpecialAccounts registry key that suppresses accounts from the logon screen. Also monitors net.exe user creation commands. The SpecialAccounts/UserList registry modification is the primary Windows-specific hidden user indicator.

Data Sources

Process: Process CreationWindows Registry: Windows Registry Key ModificationUser Account: User Account CreationMicrosoft Defender for Endpoint

Required Tables

DeviceRegistryEventsDeviceProcessEvents

False Positives & Tuning

  • Administrators configuring service accounts that should not appear on the login screen for security reasons
  • Enterprise management tools (SCCM, MDM solutions) that create management accounts hidden from regular login screens
  • Built-in Windows service accounts that are legitimately hidden via the SpecialAccounts mechanism
  • IT staff creating dedicated administrator accounts that should not be visible to standard users
Download portable Sigma rule (.yml)

Other platforms for T1564.002


Testing Methodology

Validate this detection against 3 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 1Create Hidden User Account via Registry

    Expected signal: Windows Security Event ID 4720 (User Account Created) for HiddenTestUser. Sysmon Event ID 13 (Registry Value Set) for the SpecialAccounts key. Security Event ID 4688 for net.exe and reg.exe process creation.

  2. Test 2Create Hidden Admin User Account

    Expected signal: Security Event ID 4720 (user created), 4732 (added to Administrators group), 4688 for net.exe x2 and reg.exe. Sysmon EventCode=13 for SpecialAccounts registry modification.

  3. Test 3Enumerate Hidden User Accounts

    Expected signal: Security Event ID 4688 for reg.exe process creation. The query itself does not create events but identifies existing hidden accounts. No registry write events are generated.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections