T1547.014

Active Setup

Adversaries may achieve persistence by adding a Registry key to the Active Setup of the local machine. Active Setup is a Windows mechanism that is used to execute programs when a user logs in. The value stored in the Registry key will be executed after a user logs into the computer. These programs will be executed under the context of the user and will have the account's associated permissions level. Adversaries may abuse Active Setup by creating a key under HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\ and setting a malicious value for StubPath. This value will serve as the program that will be executed when a user logs into the computer. Adversaries can abuse these components to execute malware, such as remote access tools, to maintain persistence through system reboots.

Microsoft Sentinel / Defender
kusto
let ActiveSetupPath = @"SOFTWARE\Microsoft\Active Setup\Installed Components";
let KnownGUIDs = dynamic([
  "{89820200-ECBD-11cf-8B85-00AA005B4383}",
  "{22d6f312-b0f6-11d0-94ab-0080c74c7e95}",
  "{2C7339CF-2B09-4501-B3F3-F3508C9228ED}",
  "{44BBA840-CC51-11CF-AAFA-00AA00B6015C}",
  "{6BF52A52-394A-11d3-B153-00C04F79FAA6}",
  "{89B4C1CD-B018-4511-B0A1-5476DBF70820}"
]);
DeviceRegistryEvents
| where Timestamp > ago(24h)
| where RegistryKey has ActiveSetupPath
| where ActionType in ("RegistryValueSet", "RegistryKeyCreated")
| extend GUID = extract(@"Installed Components\\({[^}]+})", 1, RegistryKey)
| extend IsKnownGUID = GUID in (KnownGUIDs)
| extend IsStubPath = RegistryKey endswith "StubPath" or RegistryValueName =~ "StubPath"
| extend StubPathValue = iff(IsStubPath, tostring(RegistryValueData), "")
| extend SuspiciousStubPath = StubPathValue has_any ("cmd.exe", "powershell", "mshta.exe", "rundll32", "regsvr32", "wscript", "cscript", "certutil", ".bat", ".vbs", ".js", ".hta", "http://", "https://")
| where not(IsKnownGUID) or IsStubPath
| project Timestamp, DeviceName, AccountName, ActionType, RegistryKey, RegistryValueName, RegistryValueData, GUID, IsKnownGUID, IsStubPath, SuspiciousStubPath, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc
high severity high confidence

Data Sources

Windows Registry: Registry Key Creation Windows Registry: Registry Key Modification Command: Command Execution Microsoft Defender for Endpoint

Required Tables

DeviceRegistryEvents

False Positives

  • Software installations that use Active Setup to run first-use configuration commands (e.g., Microsoft Office, Visual Studio, .NET Framework adding per-user registry settings)
  • Windows component updates that modify existing Active Setup entries to update version numbers, triggering re-execution of StubPath commands
  • Group Policy deployed applications that use Active Setup to ensure per-user installation on first logon to shared workstations/terminal servers
  • Antivirus or endpoint security products that register Active Setup entries for per-user agent configuration

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections