any where host.os.type == "windows" and event.provider: "Microsoft-Windows-Security-Auditing" and
event.action : "Token Right Adjusted Events" and
winlog.event_data.EnabledPrivilegeList : "SeDebugPrivilege" and
/* exclude processes with System Integrity */
not winlog.event_data.SubjectUserSid : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
not winlog.event_data.ProcessName :
("?:\\Windows\\System32\\msiexec.exe",
"?:\\Windows\\SysWOW64\\msiexec.exe",
"?:\\Windows\\System32\\lsass.exe",
"?:\\Windows\\WinSxS\\*",
"?:\\Program Files\\*",
"?:\\Program Files (x86)\\*",
"?:\\Windows\\System32\\MRT.exe",
"?:\\Windows\\System32\\cleanmgr.exe",
"?:\\Windows\\System32\\taskhostw.exe",
"?:\\Windows\\System32\\mmc.exe",
"?:\\Users\\*\\AppData\\Local\\Temp\\*-*\\DismHost.exe",
"?:\\Windows\\System32\\auditpol.exe",
"?:\\Windows\\System32\\wbem\\WmiPrvSe.exe",
"?:\\Windows\\SysWOW64\\wbem\\WmiPrvSe.exe")
Install detection rules in Elastic Security
Detect SeDebugPrivilege Enabled by a Suspicious Process in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(opens in a new tab or window).