Windows Security: Failed Code Integrity Checks (Event 5038/6281)
Alerts on Windows Security code integrity failures (Event 5038/6281) that may indicate modified or corrupted binaries.
- Product
- windows
- Service
- security
- Author
- Thomas Patzke (SigmaHQ), DRL 1.1
- Published
- 2019-12-03
- Updated
- 2026-07-31
ATT&CK techniques
Defense EvasionRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule flags Windows Security events indicating code integrity verification failures, such as missing page hashes or corrupted drivers, which can result from unauthorized modification. Attackers may trigger these failures when tampering with binaries or drivers to evade security controls or persist. It relies on Windows Security log telemetry for EventID 5038 and 6281 and uses optional vendor-path exclusions to reduce noise from specific environments.
Reporting behind it
- learn.microsoft.comhttps://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-5038
- learn.microsoft.comhttps://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-6281
- github.comhttps://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/security/win_security_codeintegrity_check_failure.yml
Changelog
v2- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: "Windows Security: Failed Code Integrity Checks (Event 5038/6281)"
id: 5a55f0c4-2d01-4f9f-b4a3-607bbbfdae64
status: stable
description: This rule flags Windows Security events indicating code integrity verification failures, such as missing page hashes or corrupted drivers, which can result from unauthorized modification. Attackers may trigger these failures when tampering with binaries or drivers to evade security controls or persist. It relies on Windows Security log telemetry for EventID 5038 and 6281 and uses optional vendor-path exclusions to reduce noise from specific environments.
references:
- https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-5038
- https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-6281
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/security/win_security_codeintegrity_check_failure.yml
author: Thomas Patzke, Huntrule Team
date: 2019-12-03
modified: 2025-01-19
tags:
- attack.stealth
- attack.t1027.001
logsource:
product: windows
service: security
detection:
selection:
EventID:
- 5038
- 6281
filter_optional_crowdstrike:
param1|contains:
- \CSFalconServiceUninstallTool_
- \Program Files\CrowdStrike\
- \System32\drivers\CrowdStrike\
- \Windows\System32\ScriptControl64_
filter_optional_sophos:
param1|contains: \Program Files\Sophos\
condition: selection and not 1 of filter_optional_*
falsepositives:
- Disk device errors
level: informational
license: DRL-1.1
related:
- id: 470ec5fa-7b4e-4071-b200-4c753100f49b
type: derived