Skip to content

Commit 44b74d1

Browse files
committed
MCAS: MITRE Behaviors
1 parent 284595b commit 44b74d1

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Behaviour Detections
2+
3+
#### Description
4+
Recently (March, 2023) Microsoft has published two new tables in the Advanced Hunting schema, those being BehaviorInfo and BehaviorEntities. This query leverages both tables to ensure the best results. The query is based on a treshold of 3 Mitre Att&ck techniques being executed. The current query can be changes to look for 3 unique techniques, by changing the TotalTechniques to UniqueTechniques. The query lists all behaviours and the entity information that could be retrieved. If you do not want to list all information, but for example only alert on a user that has performed numerous techniques, then you can comment the last 6 rows out. If you do recieve to many false positives because of single techniques, this query can help you reduce the number of FPs and only alert if multi technique incidents take place.
5+
6+
#### Risk
7+
An actor has taken over an account and performes multiple techniques to reach his goal.
8+
9+
#### References
10+
- https://learn.microsoft.com/en-us/microsoft-365/security/defender/advanced-hunting-behaviorentities-table?view=o365-worldwide
11+
- https://learn.microsoft.com/en-us/microsoft-365/security/defender/advanced-hunting-behaviorinfo-table?view=o365-worldwide
12+
- https://learn.microsoft.com/en-us/defender-cloud-apps/behaviors
13+
14+
## Defender For Endpoint
15+
```
16+
let AlertThreshold = 3;
17+
BehaviorInfo
18+
// Display all Techniques in a row
19+
| mv-expand todynamic(AttackTechniques)
20+
// Summarize results to get statistics and lists
21+
| summarize TotalTechniques = count(), Techniques = make_set(AttackTechniques), BehaviourIds = make_set(BehaviorId), arg_max(Timestamp, *) by AccountObjectId
22+
| extend UniqueTechniques = array_length(Techniques)
23+
// Check if the AlertThreshold is met. This can also be changed to Unique Techniques, depending on your needs.
24+
| where TotalTechniques >= AlertThreshold
25+
// Display all Behaviour Ids in a row and collect the entities. If you only want to alert based on the amount and not get the results yet, then the rows below can be filtered.
26+
| mv-expand todynamic(BehaviourIds)
27+
| extend BehaviourIdsString = tostring(BehaviourIds)
28+
| join BehaviorEntities on $left.BehaviourIdsString == $right.BehaviorId
29+
| project-away BehaviourIds, AccountObjectId1, AdditionalFields1, ActionType1, BehaviorId1, Categories1, DataSources1, Timestamp
30+
| project-reorder AccountObjectId, TotalTechniques, UniqueTechniques, Techniques, Categories, Description, DetectionSource
31+
| sort by AccountObjectId
32+
```
33+
## Sentinel
34+
```
35+
let AlertThreshold = 3;
36+
BehaviorInfo
37+
// Display all Techniques in a row
38+
| mv-expand todynamic(AttackTechniques)
39+
// Summarize results to get statistics and lists
40+
| summarize TotalTechniques = count(), Techniques = make_set(AttackTechniques), BehaviourIds = make_set(BehaviorId), arg_max(TimeGenerated, *) by AccountObjectId
41+
| extend UniqueTechniques = array_length(Techniques)
42+
// Check if the AlertThreshold is met. This can also be changed to Unique Techniques, depending on your needs.
43+
| where TotalTechniques >= AlertThreshold
44+
// Display all Behaviour Ids in a row and collect the entities. If you only want to alert based on the amount and not get the results yet, then the rows below can be filtered.
45+
| mv-expand todynamic(BehaviourIds)
46+
| extend BehaviourIdsString = tostring(BehaviourIds)
47+
| join BehaviorEntities on $left.BehaviourIdsString == $right.BehaviorId
48+
| project-away BehaviourIds, AccountObjectId1, AdditionalFields1, ActionType1, BehaviorId1, Categories1, DataSources1, TimeGenerated
49+
| project-reorder AccountObjectId, TotalTechniques, UniqueTechniques, Techniques, Categories, Description, DetectionSource
50+
| sort by AccountObjectId
51+
```

MITRE ATT&CK/Mapping.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This section only includes references to queries that can be mapped in the MITRE
1919
| Technique ID | Title | Query |
2020
| --- | --- | --- |
2121
| T1047 | Windows Management Instrumentation | [WMIC Remote Command Execution](../Defender%20For%20Endpoint/WMICRemoteCommand.md) |
22-
| T1047 | Windows Management Instrumentation | [WMIC Antivirus Discovery](../Defender%20For%20Endpoint/WMICAntivirusDiscovery.md)/ |
22+
| T1047 | Windows Management Instrumentation | [WMIC Antivirus Discovery](../Defender%20For%20Endpoint/WMICAntivirusDiscovery.md) |
2323

2424
## Persistence
2525

0 commit comments

Comments
 (0)