-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
Copy pathAlertsOnHost.txt
27 lines (27 loc) · 1011 Bytes
/
AlertsOnHost.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Name: Alerts On Host
// Description: Any Alerts that fired on a given host during the range of +6h and -3d
//
// Entity: Host
// Input: Compromised Host, (HostName)
// Output: Alerts
//
// QueryPeriod: +6h and -3d default, change as needed
//
// Data Source: SecurityAlert
//
// Tactics: #Persistence, #Discovery, #Lateral Movement, #Collection
//
let GetAllAlertsOnHost = (suspiciousEventTime:datetime, v_Host:string){
//-3d and +6h as some alerts fire after accumulation of events
let v_StartTime = suspiciousEventTime-3d;
let v_EndTime = suspiciousEventTime+6h;
SecurityAlert
| where TimeGenerated between (v_StartTime .. v_EndTime)
// expand JSON properties
| extend Extprop = parse_json(ExtendedProperties)
| extend Computer = toupper(tostring(Extprop["Compromised Host"]))
| where Computer contains v_Host
| project TimeGenerated, AlertName, Computer, ExtendedProperties
};
// change datetime value and hostname value below
GetAllAlertsOnHost(datetime('2019-01-20T10:02:51.000'), toupper("<hostname>"))