Skip to content

Commit 20f4386

Browse files
committed
chore(rules): Reduce false positives
Changeset: - Thread context set from unbacked memory: include the taskhostw.exe exception - Hidden registry key creation: Make sure the callstack contains the *SetValueKey symbol - Clear Eventlog: Demote severity to medium and exclude the system process - Hidden registry key creation: include explorer.exe exception - Potential process injection via tainted memory section: discard all processes from the Program Files/Program Files (x86) directories - Script interpreter host or untrusted process persistence: include msedge.exe exceptions
1 parent 2373ecc commit 20f4386

7 files changed

+33
-20
lines changed

rules/defense_evasion_clear_eventlog.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Clear Eventlog
22
id: 692d3143-e1fb-4dab-8c9c-3109ff80ec85
3-
version: 1.0.0
3+
version: 1.0.1
44
description: |
55
Identifies attempts to clear Windows event log stores. Adversaries attempt to evade detection or
66
destroy forensic evidence on a system to cover their trails and slow down incident response.
@@ -19,11 +19,11 @@ condition: >
1919
sequence
2020
maxspan 1m
2121
by file.object
22-
|set_file_information and file.info_class = 'EOF' and file.info.eof_size > 50000 and file.name imatches '?:\\Windows\\System32\\winevt\\Logs\\*.evtx'|
22+
|set_file_information and kevt.pid != 4 and file.info_class = 'EOF' and file.info.eof_size > 50000 and file.name imatches '?:\\Windows\\System32\\winevt\\Logs\\*.evtx'|
2323
|set_file_information and file.info_class = 'Allocation' and file.info.allocation_size > 50000|
2424
2525
output: >
2626
Windows Eventlog store %1.file.name was cleared
27-
severity: high
27+
severity: medium
2828

2929
min-engine-version: 2.3.0

rules/defense_evasion_hidden_registry_key_creation.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Hidden registry key creation
22
id: 65deda38-9b1d-42a0-9f40-a68903e81b49
3-
version: 1.0.1
3+
version: 1.1.0
44
description: |
55
Identifies the creation of a hidden registry key. Adversaries can utilize the
66
native NtSetValueKey API to create a hidden registry key and conceal payloads
@@ -17,15 +17,19 @@ references:
1717

1818
condition: >
1919
set_value and kevt.pid != 4 and registry.key.name endswith '\\'
20-
and
20+
and
21+
thread.callstack.symbols imatches ('ntdll.dll!NtSetValueKey', 'ntdll.dll!ZwSetValueKey')
22+
and
2123
thread.callstack.symbols not imatches ('KernelBase.dll!RegSetValue*', 'KernelBase.dll!RegLoadAppKey*', 'KernelBase.dll!GetFileAttributes*')
2224
and
2325
not
2426
ps.exe imatches
2527
(
2628
'?:\\Program Files (x86)\\Microsoft\\EdgeUpdate\\MicrosoftEdgeUpdate.exe',
2729
'?:\\Program Files\\Microsoft\\EdgeUpdate\\MicrosoftEdgeUpdate.exe',
28-
'?:\\Windows\\System32\\sppsvc.exe'
30+
'?:\\Windows\\System32\\sppsvc.exe',
31+
'?:\\Windows\\System32\\compattelrunner.exe',
32+
'?:\\Windows\\explorer.exe'
2933
)
3034
3135
output: >

rules/defense_evasion_potential_process_hollowing_injection.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Potential Process Hollowing
22
id: 2a3fbae8-5e8c-4b71-b9da-56c3958c0d53
3-
version: 1.1.1
3+
version: 1.1.2
44
description: |
55
Adversaries may inject malicious code into suspended and hollowed processes in order to
66
evade process-based defenses. Process hollowing is a method of executing arbitrary code
@@ -31,8 +31,8 @@ condition: >
3131
maxspan 2m
3232
|spawn_process and ps.sid not in ('S-1-5-18', 'S-1-5-19', 'S-1-5-20') and not ps.exe imatches
3333
(
34-
'?:\\Program Files\\*',
35-
'?:\\Program Files (x86)\\*'
34+
'?:\\Program Files\\*.exe',
35+
'?:\\Program Files (x86)\\*.exe'
3636
)
3737
| by ps.child.uuid
3838
|unmap_view_of_section and file.view.size > 20000 and file.view.protection != 'READONLY' and (length(file.name) = 0 or not ext(file.name) = '.dll')| by ps.uuid

rules/defense_evasion_potential_process_injection_via_tainted_memory_section.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ references:
2222
condition: >
2323
sequence
2424
maxspan 1m
25-
|map_view_of_section and file.view.protection = 'READWRITE' and kevt.pid != 4 and file.view.size >= 4096| as e1
26-
|map_view_of_section and file.view.protection = 'READONLY|EXECUTE' and file.key = $e1.file.key and kevt.pid != $e1.kevt.pid and not ps.exe imatches
25+
|map_view_of_section and file.view.protection = 'READWRITE' and kevt.pid != 4 and file.view.size >= 4096 and not ps.exe imatches
2726
(
28-
'?:\\Program Files\\Mozilla Firefox\\firefox.exe',
29-
'?:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe'
27+
'?:\\Program Files\\*.exe',
28+
'?:\\Program Files (x86)\\*.exe'
3029
)
31-
|
30+
| as e1
31+
|map_view_of_section and file.view.protection = 'READONLY|EXECUTE' and file.key = $e1.file.key and kevt.pid != $e1.kevt.pid|
3232
action:
3333
- name: kill
3434

rules/defense_evasion_thread_context_set_from_unbacked_memory.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Thread context set from unbacked memory
22
id: f8219274-ee68-416b-8489-4d2e635c7844
3-
version: 1.0.1
3+
version: 1.0.2
44
description: |
55
Identifies manipulation of the thread context from unbacked memory region. This may be
66
indicative of process injection.
@@ -20,7 +20,8 @@ condition: >
2020
(
2121
'?:\\Program Files\\Git\\mingw64\\bin\\git.exe',
2222
'?:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe',
23-
'?:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe'
23+
'?:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe',
24+
'?:\\Windows\\System32\\taskhostw.exe'
2425
)
2526
2627
min-engine-version: 2.2.0

rules/defense_evasion_unsigned_dll_injection_via_remote_thread.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Unsigned DLL injection via remote thread
22
id: 21bdd944-3bda-464b-9a72-58fd37ba9163
3-
version: 1.0.0
3+
version: 1.0.1
44
description: |
55
Identifies unsigned DLL injection via remote thread creation.
66
Adversaries may inject dynamic-link libraries (DLLs) into processes in order to evade process-based defenses
@@ -24,8 +24,8 @@ condition: >
2424
maxspan 1m
2525
|create_remote_thread and not (ps.exe imatches
2626
(
27-
'?:\\Program Files\\*',
28-
'?:\\Program Files (x86)\\*'
27+
'?:\\Program Files\\*.exe',
28+
'?:\\Program Files (x86)\\*.exe'
2929
)
3030
or
3131
(ps.exe imatches 'C:\\Windows\\System32\\svchost.exe' and ps.args iin ('-k', 'DcomLaunch'))

rules/persistence_script_interpreter_or_untrusted_process_persistence.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Script interpreter host or untrusted process persistence
22
id: cc41ee3a-6e44-4903-85a4-0147ec6a7eea
3-
version: 1.0.1
3+
version: 1.0.2
44
description: |
55
Identifies the script interpreter or untrusted process writing
66
to commonly abused run keys or the Startup folder locations.
@@ -31,6 +31,14 @@ condition: >
3131
or
3232
file.name imatches startup_locations
3333
)
34+
and
35+
not
36+
ps.exe imatches
37+
(
38+
'?:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe',
39+
'?:\\Program Files (x86)\\Microsoft\\Edge\\Application\\*\\msedge.exe',
40+
'?:\\Program Files\\Microsoft\\Edge\\Application\\*\\msedge.exe'
41+
)
3442
action:
3543
- name: kill
3644

0 commit comments

Comments
 (0)