Quick heads-up if you're writing KQL for LSASS dumping (stop filtering on process names)
I know this is well known to seasoned detection engineers, and you'll likely have detection rules that actively monitor these events, but I was just auditing some older detection logic in a client environment and realised their primary credential-dumping alert was still looking for FileName == "lsass.exe" inside DeviceProcessEvents.
If you're doing this, an adversary just has to rename their tool to svchost.exe or update.exe, and you are completely blind. DeviceProcessEvents is for process creation, not for process access.
To reliably detect this without generating massive false-positive fatigue from legitimate system noise, you need to query DeviceEvents, filter for OpenProcessApiCall, and explicitly parse the target image from the JSON fields to check the specific access masks.
Here is the clean KQL block that works well in production and looks for 0x1010 (query/read) and 0x1438 (common tool default):
DeviceEvents | where TimeGenerated > ago(1d) | where ActionType == "OpenProcessApiCall" | extend TargetProcess = tostring(AdditionalFields.TargetImageFile) | extend GrantedAccess = tostring(AdditionalFields.GrantedAccess) | where TargetProcess =~ "lsass.exe" | where GrantedAccess in ("0x1010", "0x1410", "0x1438", "0x143a", "0x1f0fff") | where not (InitiatingProcessFolderPath startswith @"c:\windows\system32\" or InitiatingProcessFolderPath startswith @"c:\program files\") | project TimeGenerated, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine, TargetProcess, GrantedAccess Found a couple of weird administrative edge cases with legitimate monitoring agents tripping this in a tight loop, so you'll definitely want to tune the folder path exclusions based on whatever endpoint agents your org uses.
Run in your environment to test variants of specific techniques and see what the telemetry looks like.
Curious if anyone else has run into specific bypasses of 0x1010 filtering when attackers manipulate handle rights directly?
[link] [comments]