T1546.002

Screensaver

Adversaries may establish persistence by modifying the Windows screensaver configuration. Screensavers are programs that execute after a configurable time of user inactivity and consist of Portable Executable (PE) files with a .scr file extension. Adversaries can abuse this by modifying the SCRNSAVE.EXE registry value in HKCU\Control Panel\Desktop to point to a malicious executable that runs whenever the screen saver activates.

Microsoft Sentinel / Defender
kusto
let ScreeSaverKeys = dynamic([
  "HKEY_CURRENT_USER\\Control Panel\\Desktop",
  "HKCU\\Control Panel\\Desktop"
]);
let ScreeSaverValues = dynamic(["SCRNSAVE.EXE", "ScreenSaveActive", "ScreenSaverIsSecure", "ScreenSaveTimeOut"]);
DeviceRegistryEvents
| where Timestamp > ago(24h)
| where RegistryKey has "Control Panel\\Desktop"
| where RegistryValueName in~ (ScreeSaverValues)
| where ActionType in ("RegistryValueSet", "RegistryKeyCreated")
| extend IsScreeSaverPath = RegistryValueName =~ "SCRNSAVE.EXE"
| extend SuspiciousPath = RegistryValueData has_any (
    "AppData", "Temp", "ProgramData", "Users\\Public",
    "powershell", "cmd.exe", "wscript", "cscript", "rundll32"
  )
| extend NotSystemScr = IsScreeSaverPath and not(RegistryValueData has_any (
    "C:\\Windows\\system32\\",
    "C:\\Windows\\SysWOW64\\"
  ))
| project Timestamp, DeviceName, AccountName, ActionType, RegistryKey,
         RegistryValueName, RegistryValueData, SuspiciousPath, NotSystemScr,
         InitiatingProcessFileName, InitiatingProcessCommandLine
| where SuspiciousPath or NotSystemScr
| sort by Timestamp desc
high severity high confidence

Data Sources

Windows Registry: Registry Key Modification Microsoft Defender for Endpoint

Required Tables

DeviceRegistryEvents

False Positives

  • Corporate desktop management tools (e.g., SCCM, Group Policy) that configure screensaver timeout and path centrally
  • Legitimate third-party screensaver applications installed by users (e.g., 3D aquarium, slideshow screensavers) that install .scr files outside System32
  • IT helpdesk tools that reset screensaver settings as part of standard baseline enforcement
  • User-initiated changes through Windows Display Settings that write to the Control Panel\Desktop registry key

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections