Skip to content

Commit cc7973d

Browse files
committed
refactor(rules): Reformat rules with condensed formatting style
Introduce a new rule formatting style for better readability and standardization. Generally, the event type is the first condition in the rule, and almost always appearing as an isolated condition on the first line. All binary operators appear at the end of line, expect the unary not operator.
1 parent 9b06895 commit cc7973d

File tree

74 files changed

+895
-1002
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+895
-1002
lines changed
Lines changed: 13 additions & 15 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.4
3+
version: 1.0.5
44
description: |
55
Identifies access to the Security Account Manager on-disk database.
66
labels:
@@ -15,21 +15,19 @@ labels:
1515
subtechnique.ref: https://attack.mitre.org/techniques/T1003/002/
1616

1717
condition: >
18-
open_file
19-
and
18+
open_file and
2019
file.path imatches
21-
(
22-
'?:\\WINDOWS\\SYSTEM32\\CONFIG\\SAM',
23-
'\\Device\\HarddiskVolumeShadowCopy*\\WINDOWS\\SYSTEM32\\CONFIG\\SAM',
24-
'\\??\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy*\\WINDOWS\\SYSTEM32\\CONFIG\\SAM'
25-
)
26-
and
20+
(
21+
'?:\\WINDOWS\\SYSTEM32\\CONFIG\\SAM',
22+
'\\Device\\HarddiskVolumeShadowCopy*\\WINDOWS\\SYSTEM32\\CONFIG\\SAM',
23+
'\\??\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy*\\WINDOWS\\SYSTEM32\\CONFIG\\SAM'
24+
) and
2725
ps.exe not imatches
28-
(
29-
'?:\\Program Files\\*',
30-
'?:\\Program Files (x86)\\*',
31-
'?:\\Windows\\System32\\lsass.exe',
32-
'?:\\Windows\\System32\\srtasks.exe'
33-
)
26+
(
27+
'?:\\Program Files\\*',
28+
'?:\\Program Files (x86)\\*',
29+
'?:\\Windows\\System32\\lsass.exe',
30+
'?:\\Windows\\System32\\srtasks.exe'
31+
)
3432
3533
min-engine-version: 3.0.0

rules/credential_access_credential_access_from_backups_via_rundll32.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Credentials access from backups via Rundll32
22
id: ff43852c-486c-4870-a318-ce976d2231a5
3-
version: 1.0.1
3+
version: 1.0.2
44
description: |
55
Detects an attempt to obtain credentials from credential backups.
66
labels:
@@ -15,10 +15,8 @@ labels:
1515
subtechnique.ref: https://attack.mitre.org/techniques/T1555/004/
1616

1717
condition: >
18-
spawn_process
19-
and
20-
(ps.child.name ~= 'rundll32.exe' or ps.child.pe.file.name ~= 'rundll32.exe')
21-
and
18+
spawn_process and
19+
(ps.child.name ~= 'rundll32.exe' or ps.child.pe.file.name ~= 'rundll32.exe') and
2220
(ps.child.args iin ('keymgr.dll') and ps.child.args iin ('KRShowKeyMgr'))
2321
2422
min-engine-version: 3.0.0

rules/credential_access_credential_discovery_via_vaultcmd.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Credential discovery via VaultCmd tool
22
id: 2ce607d3-5a14-4628-be8a-22bcde97dab5
3-
version: 1.1.1
3+
version: 1.1.2
44
description: |
55
Detects the usage of the VaultCmd tool to list Windows Credentials. VaultCmd creates,
66
displays and deletes stored credentials. An adversary may abuse this to list or dump
@@ -17,8 +17,8 @@ labels:
1717
subtechnique.ref: https://attack.mitre.org/techniques/T1555/004/
1818

1919
condition: >
20-
spawn_process and (ps.child.name ~= 'VaultCmd.exe' or ps.child.pe.file.name ~= 'vaultcmd.exe')
21-
and
20+
spawn_process and
21+
(ps.child.name ~= 'VaultCmd.exe' or ps.child.pe.file.name ~= 'vaultcmd.exe') and
2222
ps.child.cmdline imatches '*/list*'
2323
2424
severity: medium

rules/credential_access_lsass_handle_leak_via_seclogon.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: LSASS handle leak via Seclogon
22
id: 5d55c938-875e-49e1-ae53-fa196d4445eb
3-
version: 1.0.1
3+
version: 1.0.2
44
description: |
55
Identifies suspicious access to LSASS process from a callstack pointing to seclogon.dll that
66
may indicate an attempt to leak an LSASS handle via abusing the Secondary Logon service in
@@ -19,8 +19,8 @@ references:
1919
- https://splintercod3.blogspot.com/p/the-hidden-side-of-seclogon-part-3.html
2020

2121
condition: >
22-
open_process and evt.arg[exe] imatches '?:\\Windows\\System32\\lsass.exe' and ps.name ~= 'svchost.exe'
23-
and
22+
open_process and
23+
evt.arg[exe] imatches '?:\\Windows\\System32\\lsass.exe' and ps.name ~= 'svchost.exe' and
2424
ps.access.mask.names in ('CREATE_PROCESS', 'DUP_HANDLE') and thread.callstack.modules imatches ('*seclogon.dll')
2525
2626
severity: high

rules/credential_access_lsass_memory_dump_via_minidumpwritedump.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: LSASS memory dump via MiniDumpWriteDump
22
id: fd7ced77-4a95-4658-80f6-6b9d7b5e3777
3-
version: 1.0.1
3+
version: 1.0.2
44
description: |
55
Identifies access to the Local Security Authority Subsystem Service (LSASS) process to dump the
66
memory via MiniDumpWriteDump API.
@@ -20,8 +20,8 @@ references:
2020
- https://www.ired.team/offensive-security/credential-access-and-credential-dumping/dumping-lsass-passwords-without-mimikatz-minidumpwritedump-av-signature-bypass
2121

2222
condition: >
23-
((open_process) or (open_thread)) and evt.arg[exe] imatches '?:\\Windows\\System32\\lsass.exe'
24-
and
23+
((open_process) or (open_thread)) and
24+
evt.arg[exe] imatches '?:\\Windows\\System32\\lsass.exe' and
2525
(thread.callstack.modules imatches ('*dbgcore.dll', '*comsvcs.dll') or thread.callstack.symbols imatches ('*MiniDumpWriteDump'))
2626
action:
2727
- name: kill

rules/credential_access_lsass_memory_dumping.yml

Lines changed: 8 additions & 9 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.3
3+
version: 1.0.4
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
@@ -23,15 +23,14 @@ condition: >
2323
sequence
2424
maxspan 2m
2525
by ps.uuid
26-
|open_process and ps.access.mask.names in ('ALL_ACCESS', 'CREATE_PROCESS', 'VM_READ', 'DUP_HANDLE')
27-
and
28-
evt.arg[exe] imatches '?:\\Windows\\System32\\lsass.exe'
29-
and
26+
|open_process and
27+
ps.access.mask.names in ('ALL_ACCESS', 'CREATE_PROCESS', 'VM_READ', 'DUP_HANDLE') and
28+
evt.arg[exe] imatches '?:\\Windows\\System32\\lsass.exe' and
3029
ps.exe not imatches
31-
(
32-
'?:\\Windows\\System32\\svchost.exe',
33-
'?:\\ProgramData\\Microsoft\\Windows Defender\\*\\MsMpEng.exe'
34-
)
30+
(
31+
'?:\\Windows\\System32\\svchost.exe',
32+
'?:\\ProgramData\\Microsoft\\Windows Defender\\*\\MsMpEng.exe'
33+
)
3534
|
3635
|write_minidump_file|
3736

rules/credential_access_lsass_process_clone_creation_via_reflection.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: LSASS process clone creation via reflection
22
id: cdf3810a-4832-446a-ac9d-d108cf2e313c
3-
version: 1.0.1
3+
version: 1.0.2
44
description: |
55
Identifies the creation of an LSASS clone process via RtlCreateProcessReflection API function.
66
Adversaries can use this technique to dump credentials material from the LSASS fork and evade
@@ -20,8 +20,8 @@ references:
2020
- https://s3cur3th1ssh1t.github.io/Reflective-Dump-Tools/
2121

2222
condition: >
23-
spawn_process and ps.name ~= 'lsass.exe' and ps.child.name ~= 'lsass.exe'
24-
and
23+
spawn_process and
24+
ps.name ~= 'lsass.exe' and ps.child.name ~= 'lsass.exe' and
2525
thread.callstack.symbols imatches ('ntdll.dll!RtlCloneUserProcess', 'ntdll.dll!RtlCreateProcessReflection')
2626
action:
2727
- name: kill
Lines changed: 42 additions & 45 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.5
3+
version: 1.0.6
44
description:
55
Identifies access to the Security Account Manager registry hives.
66
labels:
@@ -19,55 +19,52 @@ references:
1919
condition: >
2020
sequence
2121
maxspan 10m
22-
|spawn_process and not (ps.exe imatches
23-
(
24-
'?:\\Program Files\\*.exe',
25-
'?:\\Program Files (x86)\\*.exe',
26-
'?:\\Windows\\System32\\svchost.exe'
27-
)
28-
or
22+
|spawn_process and
23+
not (ps.exe imatches
24+
(
25+
'?:\\Program Files\\*.exe',
26+
'?:\\Program Files (x86)\\*.exe',
27+
'?:\\Windows\\System32\\svchost.exe'
28+
) or
2929
(ps.child.cmdline imatches '"?:\\Windows\\Microsoft.NET\\Framework\\*\\ngen.exe" ExecuteQueuedItems /LegacyServiceBehavior')
3030
)
3131
| by ps.child.uuid
32-
|open_registry
33-
and
34-
registry.path imatches 'HKEY_LOCAL_MACHINE\\SAM\\SAM\\Domains\\Account\\*'
35-
and
32+
|open_registry and
33+
registry.path imatches 'HKEY_LOCAL_MACHINE\\SAM\\SAM\\Domains\\Account\\*' and
3634
registry.path not imatches
37-
(
38-
'HKEY_LOCAL_MACHINE\\SAM\\SAM\\Domains\\Account\\Users',
39-
'HKEY_LOCAL_MACHINE\\SAM\\SAM\\Domains\\Account\\Users\\Names',
40-
'HKEY_LOCAL_MACHINE\\SAM\\SAM\\Domains\\Account',
41-
'HKEY_LOCAL_MACHINE\\SAM\\SAM\\Account\\Aliases\\*'
42-
)
43-
and
35+
(
36+
'HKEY_LOCAL_MACHINE\\SAM\\SAM\\Domains\\Account\\Users',
37+
'HKEY_LOCAL_MACHINE\\SAM\\SAM\\Domains\\Account\\Users\\Names',
38+
'HKEY_LOCAL_MACHINE\\SAM\\SAM\\Domains\\Account',
39+
'HKEY_LOCAL_MACHINE\\SAM\\SAM\\Account\\Aliases\\*'
40+
) and
4441
ps.exe not imatches
45-
(
46-
'?:\\Windows\\System32\\lsass.exe',
47-
'?:\\Windows\\System32\\RuntimeBroker.exe',
48-
'?:\\Windows\\explorer.exe',
49-
'?:\\Windows\\System32\\Taskmgr.exe',
50-
'?:\\Windows\\System32\\sihost.exe',
51-
'?:\\Windows\\System32\\SearchIndexer.exe',
52-
'?:\\Windows\\System32\\SearchProtocolHost.exe',
53-
'?:\\Windows\\System32\\svchost.exe',
54-
'?:\\Windows\\System32\\services.exe',
55-
'?:\\Windows\\System32\\taskhostw.exe',
56-
'?:\\Windows\\System32\\backgroundTaskHost.exe',
57-
'?:\\Windows\\System32\\WerFault.exe',
58-
'?:\\Windows\\System32\\ctfmon.exe',
59-
'?:\\Windows\\System32\\Wbem\\WmiPrvSE.exe',
60-
'?:\\Windows\\System32\\CompatTelRunner.exe',
61-
'?:\\Windows\\System32\\cleanmgr.exe',
62-
'?:\\Windows\\System32\\MoUsoCoreWorker.exe',
63-
'?:\\Windows\\System32\\lpremove.exe',
64-
'?:\\Windows\\System32\\LogonUI.exe',
65-
'?:\\ProgramData\\Microsoft\\Windows Defender\\*\\MsMpEng.exe',
66-
'?:\\ProgramData\\Microsoft\\Windows Defender\\*\\MpDefenderCoreService.exe',
67-
'?:\\Windows\\System32\\ApplicationFrameHost.exe',
68-
'?:\\Windows\\System32\\wbem\\WMIADAP.exe',
69-
'?:\\Windows\\System32\\cleanmgr.exe'
70-
)
42+
(
43+
'?:\\Windows\\System32\\lsass.exe',
44+
'?:\\Windows\\System32\\RuntimeBroker.exe',
45+
'?:\\Windows\\explorer.exe',
46+
'?:\\Windows\\System32\\Taskmgr.exe',
47+
'?:\\Windows\\System32\\sihost.exe',
48+
'?:\\Windows\\System32\\SearchIndexer.exe',
49+
'?:\\Windows\\System32\\SearchProtocolHost.exe',
50+
'?:\\Windows\\System32\\svchost.exe',
51+
'?:\\Windows\\System32\\services.exe',
52+
'?:\\Windows\\System32\\taskhostw.exe',
53+
'?:\\Windows\\System32\\backgroundTaskHost.exe',
54+
'?:\\Windows\\System32\\WerFault.exe',
55+
'?:\\Windows\\System32\\ctfmon.exe',
56+
'?:\\Windows\\System32\\Wbem\\WmiPrvSE.exe',
57+
'?:\\Windows\\System32\\CompatTelRunner.exe',
58+
'?:\\Windows\\System32\\cleanmgr.exe',
59+
'?:\\Windows\\System32\\MoUsoCoreWorker.exe',
60+
'?:\\Windows\\System32\\lpremove.exe',
61+
'?:\\Windows\\System32\\LogonUI.exe',
62+
'?:\\ProgramData\\Microsoft\\Windows Defender\\*\\MsMpEng.exe',
63+
'?:\\ProgramData\\Microsoft\\Windows Defender\\*\\MpDefenderCoreService.exe',
64+
'?:\\Windows\\System32\\ApplicationFrameHost.exe',
65+
'?:\\Windows\\System32\\wbem\\WMIADAP.exe',
66+
'?:\\Windows\\System32\\cleanmgr.exe'
67+
)
7168
| by ps.uuid
7269
7370
min-engine-version: 3.0.0

rules/credential_access_remote_thread_creation_into_lsass.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Remote thread creation into LSASS
22
id: e3ce8d6f-c260-48d6-9398-3c1c71726297
3-
version: 1.0.2
3+
version: 1.0.3
44
description: |
55
Identifies the creation of a remote thread in LSASS (Local Security And Authority Subsystem Service)
66
by untrusted or suspicious processes. This may indicate attempts to execute code inside the LSASS process
@@ -17,8 +17,8 @@ labels:
1717
subtechnique.ref: https://attack.mitre.org/techniques/T1003/001/
1818

1919
condition: >
20-
create_remote_thread and evt.arg[exe] imatches '?:\\Windows\\System32\\lsass.exe'
21-
and
20+
create_remote_thread and
21+
evt.arg[exe] imatches '?:\\Windows\\System32\\lsass.exe' and
2222
(ps.name iin script_interpreters or ps.name ~= 'rundll32.exe' or pe.is_signed = false or pe.is_trusted = false)
2323
2424
min-engine-version: 3.0.0
Lines changed: 10 additions & 12 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.3
3+
version: 1.0.4
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
@@ -17,18 +17,16 @@ labels:
1717
subtechnique.ref: https://attack.mitre.org/techniques/T1003/003/
1818

1919
condition: >
20-
open_file
21-
and
20+
open_file and
2221
file.path imatches
23-
(
24-
'\\Device\\HarddiskVolumeShadowCopy*\\WINDOWS\\NTDS\\ntds.dit',
25-
'?:\\WINDOWS\\NTDS\\ntds.dit'
26-
)
27-
and
22+
(
23+
'\\Device\\HarddiskVolumeShadowCopy*\\WINDOWS\\NTDS\\ntds.dit',
24+
'?:\\WINDOWS\\NTDS\\ntds.dit'
25+
) and
2826
ps.exe not imatches
29-
(
30-
'?:\\Windows\\System32\\lsass.exe',
31-
'?:\\ProgramData\\Microsoft\\Windows Defender\\*\\MsMpEng.exe'
32-
)
27+
(
28+
'?:\\Windows\\System32\\lsass.exe',
29+
'?:\\ProgramData\\Microsoft\\Windows Defender\\*\\MsMpEng.exe'
30+
)
3331
3432
min-engine-version: 3.0.0

0 commit comments

Comments
 (0)