T1546.001 Elastic Security · Elastic

Detect Change Default File Association in Elastic Security

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.

MITRE ATT&CK

Tactic
Privilege Escalation Persistence
Technique
T1546 Event Triggered Execution
Sub-technique
T1546.001 Change Default File Association
Canonical reference
https://attack.mitre.org/techniques/T1546/001/

Elastic Detection Query

Elastic Security (Elastic)
eql
registry where event.type in ("creation", "change") and registry.path : ("*\\SOFTWARE\\Classes\\*\\shell\\open\\command*", "*\\HKEY_CLASSES_ROOT\\*\\shell\\open\\command*") and registry.data.strings : ("*powershell*", "*cmd.exe*", "*wscript*", "*cscript*", "*mshta*", "*rundll32*", "*regsvr32*", "*certutil*", "*bitsadmin*", "*AppData*", "*\\Temp\\*", "*ProgramData*") and not registry.data.strings : ("C:\\Windows\\system32\\*", "C:\\Program Files\\*", "C:\\Program Files (x86)\\*")
high severity high confidence

Detects modification of file association handlers under HKCR or HKLM\SOFTWARE\Classes targeting the shell\open\command key with suspicious executables or paths, indicating T1546.001 persistence via file association hijacking.

Data Sources

Elastic Endpoint SecurityWinlogbeat with Sysmon

Required Tables

logs-endpoint.events.registry-*winlogbeat-*

False Positives & Tuning

  • Legitimate software installers that register new file type handlers (e.g., IDEs, media players, archive tools) during installation may modify shell\open\command keys.
  • System administrators using scripting tools like PowerShell to programmatically associate file extensions with approved internal tooling.
  • Software repair or update processes that re-register file handlers, particularly for productivity suites like Microsoft Office or LibreOffice.
Download portable Sigma rule (.yml)

Other platforms for T1546.001


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 1Change .txt File Association to cmd.exe

    Expected signal: Sysmon Event ID 13 (Registry Value Set): TargetObject contains HKCU\Software\Classes\.txt\shell\open\command, Details contains 'cmd.exe'. Security Event ID 4657 if object access auditing is enabled. Process creation for reg.exe with the add command.

  2. Test 2Change .js File Association to PowerShell

    Expected signal: Sysmon Event ID 13: TargetObject HKCU\Software\Classes\.js\shell\open\command, Details contains powershell.exe. Process creation for reg.exe.

  3. Test 3Establish Persistence via .hta File Association

    Expected signal: Sysmon Event ID 13: TargetObject HKCU\Software\Classes\.hta\shell\open\command, Details contains mshta.exe. The vbscript: protocol in the handler is a high-fidelity indicator of malicious intent.

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