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;
let rdpEnable = SecurityEvent
| where TimeGenerated > ago(1d)
| where EventID == 4657 and ObjectName has "fDenyTSConnections"
| project RdpEnableTime = TimeGenerated, Computer;
gpoChange
| join kind=inner rdpEnable on $left.SubjectAccount == $right.Computer
| where RdpEnableTime - GpoChangeTime between (0min .. 1h)
| summarize AffectedHosts = dcount(Computer) by SubjectAccount, bin(GpoChangeTime, 1h)
| where AffectedHosts > 3
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.