Skip to content

Commit 4dc6121

Browse files
committed
fix(rules): Use the correct form of the not operator
The not operator has two variants. If used in front of the operator it negates the value of the operator eval. If used in front of the binary expression, it negates the entire expression. If not used adequately, this can introduce issues. So, it is better to standardize the usage of the not operator and if meant to solely negate the result of the operator use the lhs not operator rhs pattern.
1 parent 19f80d8 commit 4dc6121

File tree

35 files changed

+82
-116
lines changed

35 files changed

+82
-116
lines changed

rules/credentail_access_file_access_to_sam_database.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: File access to SAM database
22
id: e3dace20-4962-4381-884e-40dcdde66626
3-
version: 1.0.1
3+
version: 1.0.2
44
description: |
55
Identifies access to the Security Account Manager on-disk database.
66
labels:
@@ -24,8 +24,7 @@ condition: >
2424
'\\??\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy*\\WINDOWS\\SYSTEM32\\CONFIG\\SAM'
2525
)
2626
and
27-
not
28-
ps.exe imatches
27+
ps.exe not imatches
2928
(
3029
'?:\\Program Files\\*',
3130
'?:\\Program Files (x86)\\*',

rules/credential_access_lsass_memory_dumping.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: LSASS memory dumping via legitimate or offensive tools
22
id: 335795af-246b-483e-8657-09a30c102e63
3-
version: 1.0.1
3+
version: 1.0.2
44
description: |
55
Detects an attempt to dump the LSAAS memory to the disk by employing legitimate
66
tools such as procdump, Task Manager, Process Explorer or built-in Windows tools
@@ -27,8 +27,7 @@ condition: >
2727
and
2828
kevt.arg[exe] imatches '?:\\Windows\\System32\\lsass.exe'
2929
and
30-
not
31-
ps.exe imatches
30+
ps.exe not imatches
3231
(
3332
'?:\\Windows\\System32\\svchost.exe',
3433
'?:\\ProgramData\\Microsoft\\Windows Defender\\*\\MsMpEng.exe'

rules/credential_access_potential_sam_hive_dumping.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Potential SAM hive dumping
22
id: 2f326557-0291-4eb1-a87a-7a17b7d941cb
3-
version: 1.0.2
3+
version: 1.0.3
44
description:
55
Identifies access to the Security Account Manager registry hives.
66
labels:
@@ -40,17 +40,15 @@ condition: >
4040
and
4141
registry.path imatches 'HKEY_LOCAL_MACHINE\\SAM\\SAM\\Domains\\Account\\*'
4242
and
43-
not
44-
registry.path imatches
43+
registry.path not imatches
4544
(
4645
'HKEY_LOCAL_MACHINE\\SAM\\SAM\\Domains\\Account\\Users',
4746
'HKEY_LOCAL_MACHINE\\SAM\\SAM\\Domains\\Account\\Users\\Names',
4847
'HKEY_LOCAL_MACHINE\\SAM\\SAM\\Domains\\Account',
4948
'HKEY_LOCAL_MACHINE\\SAM\\SAM\\Account\\Aliases\\*'
5049
)
5150
and
52-
not
53-
ps.exe imatches
51+
ps.exe not imatches
5452
(
5553
'?:\\Windows\\System32\\lsass.exe',
5654
'?:\\Windows\\System32\\RuntimeBroker.exe',

rules/credential_access_suspicious_access_to_active_directory_domain_database.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Suspicious access to Active Directory domain database
22
id: a30c100e-28d0-4aa0-b98d-0d38025c2c29
3-
version: 1.0.1
3+
version: 1.0.2
44
description: |
55
Detects suspicious access to the Active Directory domain database.
66
Adversaries may attempt to access or create a copy of the Active Directory
@@ -25,8 +25,7 @@ condition: >
2525
'?:\\WINDOWS\\NTDS\\ntds.dit'
2626
)
2727
and
28-
not
29-
ps.exe imatches
28+
ps.exe not imatches
3029
(
3130
'?:\\Windows\\System32\\lsass.exe',
3231
'?:\\ProgramData\\Microsoft\\Windows Defender\\*\\MsMpEng.exe'

rules/credential_access_suspicious_access_to_unattended_panther_files.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Suspicious access to Unattended Panther files
22
id: d305fb15-6ad1-4d61-a84b-ada462f23a55
3-
version: 1.0.1
3+
version: 1.0.2
44
description: |
55
Identifies suspicious to access to unattend.xml files where credentials
66
are commonly stored within the Panther directory. Adversaries may search local
@@ -27,8 +27,7 @@ condition: >
2727
'?:\\Windows\\Panther\\Unattend.xml'
2828
)
2929
and
30-
not
31-
ps.exe imatches
30+
ps.exe not imatches
3231
(
3332
'?:\\Program Files\\*',
3433
'?:\\Program Files(x86)\\*',

rules/credential_access_suspicious_access_to_windows_dpapi_master_keys.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Suspicious access to Windows DPAPI Master Keys
22
id: b1d5732a-5ad4-4cdd-8791-c22e34c591e5
3-
version: 1.0.1
3+
version: 1.0.2
44
description: |
55
Detects suspicious processes accessing the Windows Data Protection API Master keys
66
which is a sign of potential credential stealing.
@@ -33,8 +33,7 @@ condition: >
3333
'?:\\Users\\*\\AppData\\*\\Microsoft\\Protect\\S-1-12-1-*\\*'
3434
)
3535
and
36-
not
37-
ps.exe imatches
36+
ps.exe not imatches
3837
(
3938
'?:\\Program Files\\*',
4039
'?:\\Program Files(x86)\\*',

rules/credential_access_suspicious_access_to_windows_manager_files.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Suspicious access to Windows Credential Manager files
22
id: 4ab688f7-94e2-481b-9c7f-c49f3a79a379
3-
version: 1.0.1
3+
version: 1.0.2
44
description: |
55
Identifies suspicious processes trying to acquire credentials from the Windows Credential Manager.
66
labels:
@@ -23,8 +23,7 @@ condition: >
2323
'?:\\Windows\\System32\\config\\systemprofile\\AppData\\*\\Microsoft\\Credentials\\*'
2424
)
2525
and
26-
not
27-
ps.exe imatches
26+
ps.exe not imatches
2827
(
2928
'?:\\Program Files\\*',
3029
'?:\\Program Files(x86)\\*',

rules/credential_access_suspicious_access_to_windows_vault_files.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Suspicious access to Windows Vault files
22
id: 44400221-f98d-424a-9388-497c75b18924
3-
version: 1.0.1
3+
version: 1.0.2
44
description: |
55
Identifies attempts from adversaries to acquire credentials from Vault files.
66
labels:
@@ -25,8 +25,7 @@ condition: >
2525
and
2626
file.extension in vault_extensions
2727
and
28-
not
29-
ps.exe imatches
28+
ps.exe not imatches
3029
(
3130
'?:\\Program Files\\*',
3231
'?:\\Program Files(x86)\\*',

rules/credential_access_unusual_access_to_ssh_keys.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Unusual access to SSH keys
22
id: 90f5c1bd-abd6-4d1b-94e0-229f04473d60
3-
version: 1.0.2
3+
version: 1.0.3
44
description: |
55
Identifies access by unusual process to saved SSH keys.
66
labels:
@@ -17,17 +17,15 @@ labels:
1717
condition: >
1818
open_file and file.path imatches '?:\\Users\\*\\.ssh\\known_hosts'
1919
and
20-
not
21-
ps.exe imatches
20+
ps.exe not imatches
2221
(
2322
'?:\\Program Files\\*',
2423
'?:\\Program Files(x86)\\*',
2524
'?:\\ProgramData\\Microsoft\\Windows Defender\\*\\MsMpEng.exe',
2625
'?:\\Windows\\System32\\svchost.exe'
2726
)
2827
and
29-
not
30-
ps.name imatches
28+
ps.name not imatches
3129
(
3230
'PuTTYNG.exe',
3331
'putty*.exe',

rules/credential_access_unusual_access_to_windows_credential_history.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Unusual access to Windows Credential history files
22
id: 9d94062f-2cf3-407c-bd65-4072fe4b167f
3-
version: 1.0.2
3+
version: 1.0.3
44
description: |
55
Detects unusual accesses to the Windows Credential history file.
66
The CREDHIST file contains all previous password-linked master key hashes used by
@@ -20,8 +20,7 @@ labels:
2020
condition: >
2121
open_file and file.path imatches '?:\\Users\\*\\AppData\\*\\Microsoft\\Protect\\CREDHIST'
2222
and
23-
not
24-
ps.exe imatches
23+
ps.exe not imatches
2524
(
2625
'?:\\Program Files\\*',
2726
'?:\\Windows\\System32\\lsass.exe',

0 commit comments

Comments
 (0)