Detect Change Default File Association in Google Chronicle
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/
YARA-L Detection Query
rule t1546_001_file_association_hijack {
meta:
author = "Argus Detection Engineering"
description = "Detects modification of file extension shell open command handlers to point to suspicious executables, indicating T1546.001 persistence."
severity = "HIGH"
mitre_attack_tactic = "Persistence"
mitre_attack_technique = "T1546.001"
reference = "https://attack.mitre.org/techniques/T1546/001/"
version = "1.0"
events:
$e.metadata.event_type = "REGISTRY_MODIFICATION"
$e.target.registry.registry_key = /(?i)(software\\classes\\|hkey_classes_root\\)/
$e.target.registry.registry_key = /(?i)shell\\open\\command/
(
$e.target.registry.registry_value_data = /(?i)(powershell|cmd\.exe|wscript|cscript|mshta|rundll32|regsvr32|certutil|bitsadmin)/ or
$e.target.registry.registry_value_data = /(?i)(appdata|\\temp\\|programdata)/
)
not $e.target.registry.registry_value_data = /(?i)(c:\\windows\\system32\\|c:\\program files\\|c:\\program files \(x86\)\\)/
condition:
$e
} Detects registry modification events in Chronicle UDM where a file extension's shell open command handler is changed to point to a suspicious executable or non-standard path, consistent with T1546.001 file association hijacking for persistence.
Data Sources
Required Tables
False Positives & Tuning
- System provisioning automation (Ansible, Chef, Puppet) that configures file associations across endpoints as part of baseline hardening or software deployment.
- Browser installations (Chrome, Firefox, Edge) that register themselves as handlers for web-related file types (.html, .mhtml) with binaries located in user profile directories.
- Portable application frameworks that install executables in AppData and register file type handlers to avoid requiring administrative privileges.
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.