Skip to content

Commit 4c01cd3

Browse files
committed
refactor(rules): Adapt rules and macros to use new module/dll fields
1 parent 96141d2 commit 4c01cd3

26 files changed

Lines changed: 70 additions & 76 deletions

File tree

rules/credential_access_lsass_access_from_unsigned_executable.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: LSASS access from unsigned executable
22
id: 348bf896-2201-444f-b1c9-e957a1f063bf
3-
version: 1.0.1
3+
version: 1.0.2
44
description: |
55
Detects attempts by an unsigned process to access the Local Security Authority Subsystem Service (LSASS).
66
Adversaries may try to dump credential information stored in the process memory of LSASS.
@@ -26,7 +26,7 @@ action:
2626
- name: kill
2727

2828
output: >
29-
Unsigned executable %1.image.path attempted to access Local Security Authority Subsystem Service
29+
Unsigned executable %1.module.path attempted to access Local Security Authority Subsystem Service
3030
severity: high
3131

3232
min-engine-version: 3.0.0

rules/credential_access_suspicious_vault_client_dll_load.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Suspicious Vault client DLL load
22
id: 64af2e2e-2309-4079-9c0f-985f1dd930f5
3-
version: 1.0.4
3+
version: 1.0.5
44
description: |
55
Identifies loading of the Vault client DLL by an unusual process. Adversaries can abuse the functions provided
66
by the Credential Vault Client Library to enumerate or harvest saved credentials.
@@ -46,7 +46,7 @@ condition: >
4646
(ps.parent.exe imatches '?:\\Program Files\\Microsoft OneDrive\\OneDriveStandaloneUpdater.exe')
4747
)
4848
|
49-
|load_dll and image.name ~= 'vaultcli.dll'|
49+
|load_dll and dll.name ~= 'vaultcli.dll'|
5050
5151
output: >
5252
Suspicious process %2.ps.exe loaded the Credential Vault Client DLL for potential credentials harvesting

rules/defense_evasion_appdomain_manager_injection_via_clr_search_order_hijacking.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ references:
2525
- https://www.rapid7.com/blog/post/2023/05/05/appdomain-manager-injection-new-techniques-for-red-teams/
2626

2727
condition: >
28-
(load_unsigned_or_untrusted_module)
29-
and ps.exe != '' and ((base(dir(image.path)) ~= base(image.path, false)) or (ps.envs[APPDOMAIN_MANAGER_ASM] istartswith image.name)) and
30-
ps.pe.is_dotnet and (image.is_dotnet or thread.callstack.symbols imatches ('clr.dll!ParseManifest*'))
28+
(load_unsigned_or_untrusted_module) and
29+
ps.exe != '' and ((base(dir(module.path)) ~= base(module.path, false)) or (ps.envs[APPDOMAIN_MANAGER_ASM] istartswith module.name)) and
30+
ps.pe.is_dotnet and (module.pe.is_dotnet or thread.callstack.symbols imatches ('clr.dll!ParseManifest*'))
3131
3232
output: >
33-
Process %ps.exe loaded untrusted .NET assembly %image.path from suspicious location
33+
Process %ps.exe loaded untrusted .NET assembly %module.path from suspicious location
3434
severity: high
3535

3636
min-engine-version: 3.0.0

rules/defense_evasion_dll_loaded_via_apc_queue.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: DLL loaded via APC queue
22
id: e1ee3912-ad7c-4acb-80f4-84db87e54d5e
3-
version: 1.0.3
3+
version: 1.0.4
44
description: |
55
Identifies loading of a DLL with a callstack originating from the thread
66
alertable state that led to the execution of an APC routine. This may be
@@ -16,7 +16,7 @@ references:
1616
- https://github.com/Idov31/Cronos
1717

1818
condition: >
19-
load_dll and image.name iin
19+
load_dll and dll.name iin
2020
(
2121
'winhttp.dll', 'clr.dll', 'bcrypt.dll', 'bcryptprimitives.dll',
2222
'wininet.dll', 'taskschd.dll', 'dnsapi.dll', 'coreclr.dll', 'ws2_32.dll',

rules/defense_evasion_dll_loaded_via_callback_function.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: DLL loaded via a callback function
22
id: c7f46d0a-10b2-421a-b33c-f4df79599f2e
3-
version: 1.0.5
3+
version: 1.0.6
44
description: |
55
Identifies module proxying as a method to conceal suspicious callstacks. Adversaries use module proxying
66
the hide the origin of the LoadLibrary call from the callstack by loading the library from the callback
@@ -21,7 +21,7 @@ condition: >
2121
maxspan 2m
2222
by ps.uuid
2323
|spawn_process|
24-
|load_dll and image.name iin
24+
|load_dll and dll.name iin
2525
(
2626
'winhttp.dll', 'clr.dll', 'bcrypt.dll', 'bcryptprimitives.dll',
2727
'wininet.dll', 'taskschd.dll', 'dnsapi.dll', 'coreclr.dll', 'ws2_32.dll',
@@ -36,7 +36,7 @@ condition: >
3636
|
3737
3838
output: >
39-
%2.image.path loaded from callback function by process %ps.exe
39+
%2.module.path loaded from callback function by process %ps.exe
4040
severity: high
4141

4242
min-engine-version: 3.0.0

rules/defense_evasion_dll_loaded_via_ldrpkernel32_overwrite.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: DLL loaded via LdrpKernel32 overwrite
22
id: 56739eda-210f-4a30-a114-d55ca60976df
3-
version: 1.0.3
3+
version: 1.0.4
44
description: |
55
Detects attempts to bypass the standard NTDLL bootstrap process by loading a malicious DLL early through hijacking.
66
The malicious DLL, containing attacker-controlled code, is loaded in place of the legitimate kernel32 DLL.
@@ -20,7 +20,7 @@ references:
2020
condition: >
2121
(load_unsigned_or_untrusted_dll) and
2222
thread.callstack.symbols imatches ('*!BaseThreadInitThunk*') and
23-
image.path not imatches '?:\\Windows\\assembly\\NativeImages_*\\System.Numerics.ni.dll' and
23+
dll.path not imatches '?:\\Windows\\assembly\\NativeImages_*\\System.Numerics.ni.dll' and
2424
not foreach(thread._callstack, $frame,
2525
$frame.symbol imatches ('?:\\Windows\\System32\\kernel32.dll!BaseThreadInitThunk*',
2626
'?:\\Windows\\SysWOW64\\kernel32.dll!BaseThreadInitThunk*',
@@ -31,7 +31,7 @@ action:
3131
- name: kill
3232

3333
output: >
34-
DLL %image.path loaded via LdrpKernel32 overwrite evasion by process %ps.exe
34+
DLL %dll.path loaded via LdrpKernel32 overwrite evasion by process %ps.exe
3535
severity: high
3636

3737
min-engine-version: 3.0.0

rules/defense_evasion_dll_sideloading_via_copied_binary.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ condition: >
2525
thread.callstack.symbols imatches ('*CopyFile*', '*MoveFile*')
2626
| by file.path
2727
|(load_dll) and
28-
dir(image.path) ~= dir(ps.exe) and
29-
ps.signature.subject icontains 'Microsoft' and ps.signature.trusted and
30-
(image.signature.type = 'NONE' or image.signature.level = 'UNCHECKED' or image.signature.level = 'UNSIGNED')
28+
dir(image.path) ~= dir(ps.exe) and ps.signature.subject icontains 'Microsoft' and ps.signature.trusted and
29+
(dll.signature.exists = false or dll.signature.trusted = false)
3130
| by ps.exe
3231
3332
min-engine-version: 3.0.0

rules/defense_evasion_dll_sideloading_via_microsoft_office_dropped_file.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ condition: >
2525
| by file.path
2626
|(load_unsigned_or_untrusted_dll) and
2727
ps.name not iin msoffice_binaries and ps.signature.trusted = true and
28-
image.path not imatches '?:\\Windows\\assembly\\NativeImages_*' and
28+
dll.path not imatches '?:\\Windows\\assembly\\NativeImages_*' and
2929
ps.exe not imatches
3030
(
3131
'?:\\Windows\\System32\\msiexec.exe',
3232
'?:\\Windows\\SysWOW64\\msiexec.exe',
3333
'?:\\Windows\\System32\\spoolsv.exe'
3434
)
35-
| by image.path
35+
| by dll.path
3636
3737
output: >
3838
Suspicious DLL %1.file.path dropped by Microsoft Office process %1.ps.exe and subsequently loaded by process %2.ps.exe

rules/defense_evasion_dotnet_assembly_loaded_by_unmanaged_process.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ references:
1818
condition: >
1919
(load_unsigned_or_untrusted_module) and
2020
ps.exe != '' and ps.pe.is_dotnet = false and
21-
(image.is_dotnet or thread.callstack.modules imatches ('*clr.dll')) and
22-
image.path not imatches
21+
(dll.pe.is_dotnet or thread.callstack.modules imatches ('*clr.dll')) and
22+
dll.path not imatches
2323
(
2424
'?:\\Windows\\assembly\\*\\*.ni.dll',
2525
'?:\\Program Files\\WindowsPowerShell\\Modules\\*\\*.dll',
@@ -36,7 +36,7 @@ condition: >
3636
)
3737
3838
output: >
39-
.NET assembly %image.path loaded by unmanaged process %ps.exe
39+
.NET assembly %dll.path loaded by unmanaged process %ps.exe
4040
severity: high
4141

4242
min-engine-version: 3.0.0

rules/defense_evasion_image_load_via_ntfs_transaction.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Image load via NTFS transaction
22
id: ce8de3d0-0768-41a7-bab9-4eca27ed1e3c
3-
version: 1.0.1
3+
version: 1.0.2
44
description: |
55
Identifies image loading of a file written to disk via NTFS transaction. Adversaries may exploit
66
the transactional API to execute code in the address space of the running process without committing
@@ -19,10 +19,10 @@ condition: >
1919
sequence
2020
maxspan 2m
2121
|create_file and thread.callstack.symbols imatches ('kernel32.dll!CreateFileTransacted*', 'ntdll.dll!RtlSetCurrentTransaction')| by file.name
22-
|load_module and evt.pid != 4| by image.name
22+
|load_module and evt.pid != 4| by module.name
2323
2424
output: >
25-
Image %2.image.name written via transactional NTFS and loaded afterward
25+
Image %2.module.name written via transactional NTFS and loaded afterward
2626
severity: high
2727

2828
min-engine-version: 3.0.0

0 commit comments

Comments
 (0)