Skip to content

Commit d207387

Browse files
committed
Active Directory: Password change after succesful brute force
1 parent cc674f9 commit d207387

File tree

2 files changed

+91
-1
lines changed

2 files changed

+91
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Password change after succesful brute force
2+
3+
## Query Information
4+
5+
#### MITRE ATT&CK Technique(s)
6+
7+
| Technique ID | Title | Link |
8+
| --- | --- | --- |
9+
| T1098 | Account Manipulation | https://attack.mitre.org/techniques/T1098/ |
10+
| T1110 | Brute Force | https://attack.mitre.org/techniques/T1110/ |
11+
12+
#### Description
13+
Adversaries may use brute force techniques to gain access to accounts when passwords are unknown or when password hashes are obtained. Without knowledge of the password for an account or set of accounts, an adversary may systematically guess the password using a repetitive or iterative mechanism. This query combines the brute force indicators with a followed password change after the adversary has gained access to an account.
14+
15+
The query uses a variety of different variables which determine the result.
16+
- *FailedLogonsThreshold* - The minimum amount of failed logons.
17+
- *SuccessfulLogonsThreshold* - The minimum amount of successful logons.
18+
- *TimeWindow* - Timewindow in which the failed and successful thresholds must be met.
19+
- *SearchWindow* - Time between the successful brute force and the password change.
20+
21+
#### Risk
22+
An adversary has successfully performed a brute force on an account and changes the password to keep persistence
23+
24+
#### References
25+
- https://attack.mitre.org/datasources/DS0002/#User%20Account%20Modification
26+
27+
## Defender For Endpoint
28+
```
29+
let FailedLogonsThreshold = 20;
30+
let SuccessfulLogonsThreshold = 1;
31+
let TimeWindow = 15m;
32+
// Time between the succesful brute force and password change. Difference should be added in minutes
33+
let SearchWindow = 120;
34+
IdentityLogonEvents
35+
// Filter emtpy UPN
36+
| where isnotempty(AccountUpn)
37+
| summarize
38+
TotalAttempts = count(),
39+
SuccessfulAttempts = countif(ActionType == "LogonSuccess"),
40+
FailedAttempts = countif(ActionType == "LogonFailed")
41+
by bin(Timestamp, TimeWindow), AccountUpn
42+
// Use variables to define brute force attack
43+
| where SuccessfulAttempts >= SuccessfulLogonsThreshold and FailedAttempts >= FailedLogonsThreshold
44+
// join password changes
45+
| join kind=inner (IdentityDirectoryEvents
46+
| where Timestamp > ago(30d)
47+
| where ActionType == "Account Password changed"
48+
| where isnotempty(TargetAccountUpn)
49+
| extend PasswordChangeTime = Timestamp
50+
| project PasswordChangeTime, TargetAccountUpn)
51+
on $left.AccountUpn == $right.TargetAccountUpn
52+
// Collect timedifference between brute force (note that is uses the bin time) and the password change
53+
| extend TimeDifference = datetime_diff('minute', PasswordChangeTime, Timestamp)
54+
// Remove all entries where the password change took place before the brute force
55+
| where TimeDifference > 0
56+
| where TimeDifference <= SearchWindow
57+
```
58+
## Sentinel
59+
```
60+
let FailedLogonsThreshold = 20;
61+
let SuccessfulLogonsThreshold = 1;
62+
let TimeWindow = 15m;
63+
// Time between the succesful brute force and password change. Difference should be added in minutes
64+
let SearchWindow = 120;
65+
IdentityLogonEvents
66+
// Filter emtpy UPN
67+
| where isnotempty(AccountUpn)
68+
| summarize
69+
TotalAttempts = count(),
70+
SuccessfulAttempts = countif(ActionType == "LogonSuccess"),
71+
FailedAttempts = countif(ActionType == "LogonFailed")
72+
by bin(TimeGenerated, TimeWindow), AccountUpn
73+
// Use variables to define brute force attack
74+
| where SuccessfulAttempts >= SuccessfulLogonsThreshold and FailedAttempts >= FailedLogonsThreshold
75+
// join password changes
76+
| join kind=inner (IdentityDirectoryEvents
77+
| where TimeGenerated > ago(30d)
78+
| where ActionType == "Account Password changed"
79+
| where isnotempty(TargetAccountUpn)
80+
| extend PasswordChangeTime = TimeGenerated
81+
| project PasswordChangeTime, TargetAccountUpn)
82+
on $left.AccountUpn == $right.TargetAccountUpn
83+
// Collect timedifference between brute force (note that is uses the bin time) and the password change
84+
| extend TimeDifference = datetime_diff('minute', PasswordChangeTime, TimeGenerated)
85+
// Remove all entries where the password change took place before the brute force
86+
| where TimeDifference > 0
87+
| where TimeDifference <= SearchWindow
88+
```

MITRE ATT&CK/Mapping.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ This section only includes references to queries that can be mapped in the MITRE
2626

2727
| Technique ID | Title | Query |
2828
| --- | --- | --- |
29+
| T1098 | Account Manipulation | [Password Change After Succesful Brute Force](../Defender%20For%20Identity/PasswordChangeAfterSuccesfulBruteForce.md)|
2930
| T1136.001 | Create Account: Local Account | [Local Account Creation](../Defender%20For%20Endpoint/LocalAccountCreated.md) |
3031
| T1136.003 | Create Account: Cloud Account | [Cloud Persistence Activity By User AtRisk](../Azure%20Active%20Directory/CloudPersistenceActivityByUserAtRisk.md) |
31-
| T1078.004 | Valid Accounts: Cloud Accounts | [Cloud Persistence Activity By User AtRisk](../Azure%20Active%20Directory/CloudPersistenceActivityByUserAtRisk.md)|
32+
| T1078.004 | Valid Accounts: Cloud Accounts | [Cloud Persistence Activity By User AtRisk](../Azure%20Active%20Directory/CloudPersistenceActivityByUserAtRisk.md)|
3233
| T1137 | Office Application Startup | [ASR Executable Office Content](../Defender%20For%20Endpoint/ASR%20Rules/AsrExecutableOfficeContent.md) |
3334

3435
## Privilege Escalation
@@ -58,6 +59,7 @@ This section only includes references to queries that can be mapped in the MITRE
5859

5960
| Technique ID | Title | Query |
6061
| --- | --- | --- |
62+
| T1110 | Brute Force | [Password Change After Succesful Brute Force](../Defender%20For%20Identity/PasswordChangeAfterSuccesfulBruteForce.md) |
6163
| T1558.003 | Steal or Forge Kerberos Tickets: Kerberoasting | [Potential Kerberos Encryption Downgrade](../Defender%20For%20Identity/PotentialKerberosEncryptionDowngrade.md) |
6264

6365
## Discovery

0 commit comments

Comments
 (0)