Sponsored by Hudson Rock – Use Hudson Rock's free cybercrime intelligence tools to learn how Infostealer infections are leading to ransomware attacks
SecurityEventlet gpoChange = SecurityEvent
| where TimeGenerated > ago(1d)
| where EventID in (5136, 5137) and ObjectClass == "groupPolicyContainer"
| project GpoChangeTime = TimeGenerated, SubjectAccount, ObjectDN;
let taskCreate = SecurityEvent
| where TimeGenerated > ago(1d)
| where EventID == 4698
| project TaskCreateTime = TimeGenerated, Computer, TaskName = EventData;
gpoChange
| join kind=inner taskCreate on $left.SubjectAccount == $right.Computer
| where TaskCreateTime - GpoChangeTime between (0min .. 1h)
| summarize AffectedHosts = dcount(Computer), Tasks = make_set(TaskName) by SubjectAccount, bin(GpoChangeTime, 1h)
| where AffectedHosts > 5
Hunting queries are starting points for threat hunting & detection engineering — validate table/column names against your own workspace schema and tune thresholds before turning any of these into a production alert rule.