Windows Native Messaging Host Registered By User Writable Binary
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.
Query · spl
`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`
Implementation guide
This search requires Sysmon logs with a Sysmon configuration that includes EventID 13 (Registry value set) for the Chrome and Edge NativeMessagingHosts keys.
If you are using Sysmon, you must have at least version 2.0 of the official Sysmon TA.
This search uses an input macro named sysmon. We strongly recommend that you specify your environment-specific configurations (index, source, sourcetype, etc.) for Windows Sysmon logs.
Replace the macro definition with configurations for your Splunk environment. The search also uses a post-filter macro designed to filter out known false positives.
Update the exclusion lists with native messaging hosts that are legitimately registered in your environment.
Known false positives
- Software that registers a native messaging host from the user profile, ProgramData or a Windows subfolder (for example password managers, document tools and collaboration clients) may be returned. Validate the host and add its registry key name or process path to the exclusion list.
Analyst notes
Known false positives: Software that registers a native messaging host from the user profile, ProgramData or a Windows subfolder (for example password managers, document tools and collaboration clients) may be returned. Validate the host and add its registry key name or process path to the exclusion list.