Detect Change Default File Association in Sumo Logic CSE
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/
Sumo Detection Query
_sourceCategory="windows/sysmon" (EventID=12 OR EventID=13 OR EventID=14) | where TargetObject matches /(?i).*Classes.*\.\w+.*shell.*open.*command.*/ | parse regex field=TargetObject "Classes\\\\(?P<Extension>\.[^\\]+)\\" nodrop | eval IsSuspiciousValue = if (TargetObject matches /(?i).*(powershell|cmd\.exe|wscript|cscript|mshta|rundll32|regsvr32|certutil|bitsadmin|AppData|\\Temp\\|ProgramData).*/, 1, 0) | eval IsUserHive = if (TargetObject matches /(?i).*(HKU|HKCU).*/, 1, 0) | eval IsLegitPath = if (Details matches /(?i).*(C:\\Windows\\system32\\|C:\\Program Files\\|C:\\Program Files \(x86\)\\).*/, 1, 0) | where IsSuspiciousValue = 1 OR IsUserHive = 1 | where IsLegitPath = 0 | fields _messageTime, Computer, User, EventID, TargetObject, Details, Extension, IsSuspiciousValue, IsUserHive, Image, CommandLine | sort - _messageTime Detects Sysmon registry modification events targeting file extension shell open command handlers with suspicious binary references or user hive modifications, indicating potential T1546.001 file association persistence.
Data Sources
Required Tables
False Positives & Tuning
- Antivirus or endpoint security products that modify file associations to intercept and scan files when opened, particularly for script file types like .js or .vbs.
- Custom enterprise tooling installed via group policy that registers proprietary file handlers pointing to binaries stored in unconventional directories.
- User-initiated software installations that store executables in AppData (e.g., Slack, Spotify, Chrome) and register file associations during setup.
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.
- 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.
- 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.
- 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.
References (5)
- https://attack.mitre.org/techniques/T1546/001/
- https://docs.microsoft.com/en-us/windows/win32/shell/fa-intro
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1546.001/T1546.001.md
- https://pentestlab.blog/2020/01/13/persistence-change-default-file-association/
- https://www.hexacorn.com/blog/2018/03/15/beyond-good-ol-run-key-part-75/
Unlock Pro Content
Get the full detection package for T1546.001 including response playbook, investigation guide, and atomic red team tests.