Detection rules › Splunk

Windows MsMpEng Writing to System32

Status
production
Severity
medium
Group by
action, computer_name, dest, dvc, file_hash, file_name, process_guid, process_id, process_name, signature, signature_id, target_filename, user_id, vendor_product
Author
Raven Tait, Splunk
Source
github.com/splunk/security_content

Detects MsMpEng.exe creating a file in C:\Windows\System32\. This should never happen under normal operation Windows Defender does not install kernel drivers at runtime. In the BlueHammer exploit, the TOCTOU race causes MsMpEng (SYSTEM) to write the attacker's driver payload directly into the drivers directory.

Known false positives

  • No false positives have been identified at this time.

MITRE ATT&CK coverage

Telemetry coverage

Rule body

name: Windows MsMpEng Writing to System32
id: dc615235-1241-411a-b170-b34a4c8924aa
version: 1
creation_date: '2026-04-27'
modification_date: '2026-04-27'
author: Raven Tait, Splunk
status: production
type: TTP
description: |-
    Detects MsMpEng.exe creating a file in C:\\Windows\\System32\\.
    This should never happen under normal operation Windows Defender does not install kernel drivers at runtime.
    In the BlueHammer exploit, the TOCTOU race causes MsMpEng (SYSTEM) to write the attacker's driver payload directly into the drivers directory.
data_source:
    - Sysmon EventID 15
    - Sysmon EventID 11
search: |-
    `sysmon`
    (EventID=15 OR EventID=11)
    Image="*\\MsMpEng.exe"
    TargetFilename="*:\\Windows\\System32\\*"
    | fillnull
    | stats count min(_time) as firstTime
                  max(_time) as lastTime
      by Computer Image TargetFilename EventID dest dvc
         file_hash file_name file_path action process_exec
         process_guid process_id process_name process_path
         signature signature_id user_id vendor_product
    | `security_content_ctime(firstTime)`
    | `security_content_ctime(lastTime)`
    | `windows_msmpeng_writing_to_system32_filter`
how_to_implement: |-
    The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the process GUID, process name, and parent process. Additionally, you must ingest complete command-line executions. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the `Processes` node of the `Endpoint` data model. Use the Splunk Common Information Model (CIM) to normalize the field names and speed up the data modeling process.
known_false_positives: |-
    No false positives have been identified at this time.
references:
    - https://github.com/Nightmare-Eclipse/BlueHammer
finding:
    title: $Image$ wrote a File or an Alternate Data Stream $TargetFilename$ on $dest$.
    entity:
        field: dest
        type: system
        score: 50
threat_objects:
    - field: Image
      type: process
    - field: TargetFilename
      type: file_path
analytic_story:
    - Windows Drivers
    - Windows Privilege Escalation
    - BlueHammer
    - RedSun
asset_type: Endpoint
mitre_attack_id:
    - T1068
    - T1543.003
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: endpoint
security_domain: endpoint
cve:
    - CVE-2026-33825

Stages and Predicates

Stage 1: search

`sysmon`
(EventID=15 OR EventID=11)
Image="*\\MsMpEng.exe"
TargetFilename="*:\\Windows\\System32\\*"

Stage 2: fillnull

| fillnull

Stage 3: stats

| stats count min(_time) as firstTime
              max(_time) as lastTime
  by Computer Image TargetFilename EventID dest dvc
     file_hash file_name file_path action process_exec
     process_guid process_id process_name process_path
     signature signature_id user_id vendor_product

Stage 4: search

| `security_content_ctime(firstTime)`

Stage 5: search

| `security_content_ctime(lastTime)`

Stage 6: search

| `windows_msmpeng_writing_to_system32_filter`

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventIDeq
  • 11 corpus 26 (splunk 24, kusto 2)
  • 15 corpus 6 (splunk 6)
field:"EventID" kind:eq
Imageeq
  • "*\\MsMpEng.exe"
field:"Image" kind:eq
TargetFilenameeq
  • "*:\\Windows\\System32\\*"
field:"TargetFilename" kind:eq