T1546.001

Change Default File Association

Adversaries may establish persistence by changing the default file association for a file extension. When a file is opened, the default program associated with the file extension is executed. Adversaries can exploit this by modifying the registry key that defines the default handler for a given file extension (e.g., .txt, .js, .hta) to point to a malicious executable, causing their payload to execute whenever a user opens a file with that extension.

Microsoft Sentinel / Defender
kusto
DeviceRegistryEvents
| where Timestamp > ago(24h)
| where RegistryKey has_any (
    "SOFTWARE\\Classes\\",
    "HKEY_CLASSES_ROOT\\"
  )
| where RegistryKey matches regex @"\\shell\\open\\command"
| where ActionType in ("RegistryValueSet", "RegistryKeyCreated")
| where RegistryValueData !has_any (
    "C:\\Windows\\system32\\",
    "C:\\Program Files\\",
    "C:\\Program Files (x86)\\"
  )
| extend Extension = extract(@"Classes\\(\.\w+)\\", 1, RegistryKey)
| extend SuspiciousHandler = RegistryValueData has_any (
    "powershell", "cmd.exe", "wscript", "cscript", "mshta",
    "rundll32", "regsvr32", "certutil", "bitsadmin", "AppData", "Temp", "ProgramData"
  )
| project Timestamp, DeviceName, AccountName, ActionType, RegistryKey,
         RegistryValueName, RegistryValueData, Extension, SuspiciousHandler,
         InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc
medium severity medium confidence

Data Sources

Windows Registry: Registry Key Modification Microsoft Defender for Endpoint

Required Tables

DeviceRegistryEvents

False Positives

  • Software installations that legitimately register file handlers (e.g., installing a new browser changes .html, .htm associations)
  • Development tools registering custom file extensions for project files (Visual Studio, JetBrains IDEs)
  • PDF readers, media players, and archiving utilities that change handler associations during install or on first run
  • Group Policy-driven file association changes pushed by IT during software deployments

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections