Suspicious System Path File Overwrite
Description
Identifies attempts to overwrite protected Windows system image (PE header) under System32 or SysWOW64. This pattern may indicate exploitation attempting to replace trusted system binaries for privilege escalation.
Query · eql
file where event.action == "overwrite" and not user.id in ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
(file.extension : ("exe", "dll") or file.Ext.header_bytes like "4d5a*") and
process.thread.Ext.call_stack_summary like "ntdll.dll*" and not process.thread.Ext.call_stack_summary like "ntdll.dll*|kernelbase.dll|*" and
file.path : ("C:\\Windows\\System32\\*",
"C:\\Windows\\SysWOW64\\*",
"C:\\Program Files (x86)\\Microsoft\\*",
"C:\\Program Files\\Microsoft\\*",
"C:\\Program Files\\Windows*",
"C:\\Program Files (x86)\\Windows*") and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "C:\\Windows\\System32\\ntdll.dll!NtCreateFile*") and
not process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and
not (process.code_signature.subject_name : ("Zebra Technologies Corporation", "Zebra Technologies Corporation", "Euro Plus d.o.o.", "Amyuni Technologies, Inc.", "Amyuni Technologies, Inc.") and
process.code_signature.trusted == true) and
not file.path : ("C:\\WINDOWS\\system32\\spool\\DRIVERS\\x64\\*",
"C:\\WINDOWS\\system32\\Drivers\\*",
"C:\\WINDOWS\\SysWOW64\\RongtaUSBMonUI.dll",
"C:\\WINDOWS\\SysWOW64\\RongtaUSBMon.dll",
"C:\\WINDOWS\\system32\\RongtaUSBMonUI.dll",
"C:\\Windows\\SysWOW64\\CyberInstallerUninstallerSystem\\*.dll")