-
Notifications
You must be signed in to change notification settings - Fork 7
/
KQL_getting_started.txt
77 lines (64 loc) · 1.97 KB
/
KQL_getting_started.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
let timeOffset = 7d;
let discardEventId = 4688;
SecurityEvent
| where TimeGenerated > ago(timeOffset*2) and TimeGenerated < ago(timeOffset)
| where EventID != discardEventId
let suspiciousAccounts = datatable(account: string) [
@"\administrator",
@"NT AUTHORITY\SYSTEM"
];
SecurityEvent | where Account in (suspiciousAccounts)
let LowActivityAccounts =
SecurityEvent
| summarize cnt = count() by Account
| where cnt < 10;
LowActivityAccounts | where Account contains "Mal"
search "err"
search in (SecurityEvent,SecurityAlert,A*) "err"
SecurityEvent
| where TimeGenerated > ago(1d)
SecurityEvent
| where TimeGenerated > ago(1h) and EventID == "4624"
SecurityEvent
| where TimeGenerated > ago(1h)
| where EventID == 4624
| where AccountType =~ "user"
SecurityEvent | where EventID in (4624, 4625)
SecurityAlert
| where TimeGenerated > ago(7d)
| extend severityOrder = case (
AlertSeverity == "High", 3,
AlertSeverity == "Medium", 2,
AlertSeverity == "Low", 1,
AlertSeverity == "Informational", 0,
-1)
let timeframe = 1d;
let DomainList = dynamic(["tor2web.org", "tor2web.com"]);
Syslog
| where TimeGenerated >= ago(timeframe)
| where ProcessName contains "squid"
| extend
HTTP_Status_Code = extract("(TCP_(([A-Z]+)…-9]{3}))",8,SyslogMessage),
Domain = extract("(([A-Z]+ [a-z]{4…Z]+ )([^ :\\/]*))",3,SyslogMessage)
| where HTTP_Status_Code == "200"
| where Domain contains "."
| where Domain has_any (DomainList)
SecurityAlert
| where TimeGenerated > ago(7d)
| extend severityOrder = case (
AlertSeverity == "High", 3,
AlertSeverity == "Medium", 2,
AlertSeverity == "Low", 1,
AlertSeverity == "Informational", 0,
-1)
| order by severityOrder desc
SecurityAlert
| where TimeGenerated > ago(7d)
| extend severityOrder = case (
AlertSeverity == "High", 3,
AlertSeverity == "Medium", 2,
AlertSeverity == "Low", 1,
AlertSeverity == "Informational", 0,
-1)
| order by severityOrder
| project-away severityOrder