Safeguard
Application Security•

Detecting and Mitigating Screensaver Persistence (T1546.002)

A screensaver is just a PE file that runs after inactivity. See how four registry values enable persistence on Windows and how to shut the door.

Safeguard Security Team
2 min read

Screensaver persistence (MITRE ATT&CK T1546.002) is a Windows technique that runs code when the user is inactive. Screensavers are Portable Executable (PE) files with a .scr extension that start after a configurable idle time.

How attackers use it

The stock Windows screensaver application, scrnsave.scr, lives in C:\Windows\System32\ and, on 64-bit Windows, C:\Windows\sysWOW64\, along with the screensavers that ship with Windows.

The settings sit in the registry under HKCU\Control Panel\Desktop\. MITRE lists four that can be manipulated:

  • SCRNSAVE.exe set to a malicious PE path.
  • ScreenSaveActive set to 1 to enable the screensaver.
  • ScreenSaverIsSecure set to 0 so no password is needed to unlock.
  • ScreenSaveTimeout to set the idle time before it runs.

An adversary sets these so malware runs after a stretch of inactivity, which also tends to happen when nobody is watching the screen.

How to detect it

MITRE's strategy joins registry changes to execution:

  • Modifications to the HKCU Control Panel Desktop values above.
  • Execution of .scr files whose image paths do not match known legitimate screensavers.
  • Execution that follows a user inactivity timeout.

A screensaver that runs from a user profile or temp directory rather than the Windows folders is a strong signal.

How to reduce the risk

  1. Block execution from odd places. MITRE advises blocking .scr files from running from non-standard locations.
  2. Remove the feature. Use Group Policy to disable screensavers if you do not need them.

Check your own environment

A read-only check from a Windows command prompt:

reg query "HKCU\Control Panel\Desktop" /v SCRNSAVE.EXE
reg query "HKCU\Control Panel\Desktop" /v ScreenSaverIsSecure

A missing SCRNSAVE.EXE value is normal where screensavers are disabled. A path outside the Windows folders is not.

Quick check

Why is ScreenSaverIsSecure set to 0 a useful clue?

It means no password is needed on unlock. Combined with an odd SCRNSAVE.exe path, it points to tampering rather than a user preference.

Sources

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.