Techniques
Sample rules
Windows Native Messaging Host Registered By User Writable Binary
- source: splunk
- technicques:
Description
The following analytic detects a binary running from a user-writable or Windows directory (C:\Users, C:\ProgramData, C:\PerfLogs or C:\Windows) that creates or modifies a Chrome or Edge NativeMessagingHosts registry key. This activity is significant because registering a native messaging host manifest lets a malicious browser extension launch arbitrary local programs, which has been abused for command and control and persistence. If confirmed malicious, an attacker could execute code through the browser each time the extension connects, outside the usual extension sandbox.
Detection logic
`sysmon` EventCode=13
registry_path IN (
"*\\Chrome\\NativeMessagingHosts\\*",
"*\\Edge\\NativeMessagingHosts\\*"
)
process_path IN (
"*:\\PerfLogs\\*",
"*:\\ProgramData\\*",
"*:\\Users\\*",
"*:\\Windows\\*"
)
NOT process_path IN (
"*:\\Windows\\Installer\\*",
"*:\\Windows\\System32\\msiexec.exe",
"*:\\Windows\\System32\\reg.exe",
"*:\\Windows\\SysWOW64\\msiexec.exe",
"*:\\Windows\\SysWOW64\\reg.exe"
)
NOT registry_path IN (
"*\\NativeMessagingHosts\\com.anthropic.claude_browser_extension\\*",
"*\\NativeMessagingHosts\\com.anthropic.claude_code_browser_extension\\*",
"*\\NativeMessagingHosts\\com.microsoft.onedrive.nucleus.auth.provider\\*",
"*\\NativeMessagingHosts\\com.soundresearch.contentclassifier\\*",
"*\\NativeMessagingHosts\\com.wps.anydocextension\\*",
"*\\NativeMessagingHosts\\com.wps.pdfextension\\*"
)
NOT user IN ("SYSTEM", "*\\SYSTEM")
| regex process_path!="(?i)[\\\\/]+AppData[\\\\/]+Local[\\\\/]+(?:[^\\\\/]+[\\\\/]+){1,}[^\\\\/]+\\.\\w+$"
| stats count min(_time) as firstTime
max(_time) as lastTime
by dest user process_guid process_id process_name process_path
registry_path registry_value_name registry_value_data
vendor_product
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `windows_native_messaging_host_registered_by_user_writable_binary_filter`