Skip to content

Commit c1bee7d

Browse files
committed
update additional analytics
1 parent 4476cd6 commit c1bee7d

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

detections/endpoint/powershell_loading_dotnet_into_memory_via_reflection.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
name: PowerShell Loading DotNET into Memory via Reflection
1+
name: PowerShell Loading DotNET Into Memory via Reflection
22
id: 85bc3f30-ca28-11eb-bd21-acde48001122
3-
version: 5
4-
date: '2024-09-30'
3+
version: 6
4+
date: '2025-01-16'
55
author: Michael Haag, Splunk
66
status: production
7-
type: TTP
7+
type: Anomaly
88
data_source:
99
- Powershell Script Block Logging 4104
10-
description: The following analytic detects the use of PowerShell to load .NET assemblies into memory via reflection, a technique often used in malicious activities such as those by Empire and Cobalt Strike. It leverages PowerShell Script Block Logging (EventCode=4104) to capture and analyze the full command executed. This behavior is significant as it can indicate advanced attack techniques aiming to execute code in memory, bypassing traditional defenses. If confirmed malicious, this activity could lead to unauthorized code execution, privilege escalation, and persistent access within the environment.
11-
search: '`powershell` EventCode=4104 ScriptBlockText IN ("*[system.reflection.assembly]::load(*","*[reflection.assembly]*", "*reflection.assembly*") | stats count min(_time) as firstTime max(_time) as lastTime by Opcode Computer UserID EventCode ScriptBlockText | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `powershell_loading_dotnet_into_memory_via_reflection_filter`'
10+
description: The following analytic detects the use of PowerShell scripts to load .NET assemblies into memory via reflection, a technique often used in malicious activities such as those by Empire and Cobalt Strike. It leverages PowerShell Script Block Logging (EventCode=4104) to capture and analyze the full command executed. This behavior is significant as it can indicate advanced attack techniques aiming to execute code in memory, bypassing traditional defenses. If confirmed malicious, this activity could lead to unauthorized code execution, privilege escalation, and persistent access within the environment.
11+
search: '`powershell` EventCode=4104 ScriptBlockText IN ("*Reflection.Assembly]::Load*", "*Reflection.Assembly.Load*", "*UnsafeLoadFrom*", "*.LoadFrom(*", "*.LoadModule(*", "*.LoadWithPartialName*", "*ReflectionOnlyLoad*") | stats count min(_time) as firstTime max(_time) as lastTime by Opcode Computer UserID EventCode ScriptBlockText | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `powershell_loading_dotnet_into_memory_via_reflection_filter`'
1212
how_to_implement: To successfully implement this analytic, you will need to enable PowerShell Script Block Logging on some or all endpoints. Additional setup here https://docs.splunk.com/Documentation/UBA/5.0.4.1/GetDataIn/AddPowerShell#Configure_module_logging_for_PowerShell.
1313
known_false_positives: False positives should be limited as day to day scripts do not use this method.
1414
references:
@@ -37,7 +37,7 @@ tags:
3737
asset_type: Endpoint
3838
confidence: 80
3939
impact: 70
40-
message: A suspicious powershell script contains reflective class assembly command in $ScriptBlockText$ to load .net code in memory with EventCode $EventCode$ in host $Computer$
40+
message: A suspicious powershell script that contains calls to reflective class assembly command in $ScriptBlockText$ is potentially trying to load malicious .NET code in memory in host $Computer$
4141
mitre_attack_id:
4242
- T1059
4343
- T1059.001

detections/endpoint/windows_change_default_file_association.yml renamed to detections/endpoint/windows_new_default_file_association_value_set.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
name: Windows Change Default File Association
1+
name: Windows New Default File Association Value Set
22
id: 462d17d8-1f71-11ec-ad07-acde48001122
33
version: 4
44
date: '2025-01-15'
55
author: Teoderick Contreras, Splunk
66
status: production
7-
type: Anomaly
8-
description: The following analytic detects suspicious registry modifications that change the default file association to execute a malicious payload. It leverages data from the Endpoint data model, specifically monitoring registry paths under "*\\shell\\open\\command\\*" and "*HKCR\\*". This activity is significant because altering default file associations can allow attackers to execute arbitrary scripts or payloads when a user opens a file, leading to potential code execution. If confirmed malicious, this technique can enable attackers to persist on the compromised host and execute further malicious commands, posing a severe threat to the environment.
7+
type: Hunting
8+
description: The following analytic detects registry changes to the default file association value. It leverages data from the Endpoint data model, specifically monitoring registry paths under "HKCR\\*\\shell\\open\\command\\*". This activity can be significant because, attackers might alter the default file associations in order to execute arbitrary scripts or payloads when a user opens a file, leading to potential code execution. If confirmed malicious, this technique can enable attackers to persist on the compromised host and execute further malicious commands, posing a severe threat to the environment.
99
data_source:
10-
- Sysmon EventID 12
1110
- Sysmon EventID 13
12-
search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Registry where Registry.registry_path="*\\shell\\open\\command\\*" Registry.registry_path="*HKCR\\*" by Registry.dest Registry.user Registry.registry_path Registry.registry_key_name Registry.registry_value_name Registry.registry_value_data | `security_content_ctime(lastTime)` | `security_content_ctime(firstTime)` | `drop_dm_object_name(Registry)` | `windows_change_default_file_association_filter`'
11+
search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Registry where Registry.registry_path="*\\shell\\open\\command\\*" Registry.registry_path IN ("*HKCR\\*", "*HKEY_CLASSES_ROOT\\*") by Registry.dest Registry.user Registry.registry_path Registry.registry_key_name Registry.registry_value_name Registry.registry_value_data | `security_content_ctime(lastTime)` | `security_content_ctime(firstTime)` | `drop_dm_object_name(Registry)` | `windows_new_default_file_association_value_set_filter`'
1312
how_to_implement: To successfully implement this search, you must be ingesting data that records registry activity from your hosts to populate the endpoint data model in the registry node. This is typically populated via endpoint detection-and-response product, such as Carbon Black or endpoint data sources, such as Sysmon. The data used for this search is typically generated via logs that report reads and writes to the registry.
14-
known_false_positives: unknown
13+
known_false_positives: Windows and third party software will create and modify these file associations during installation or upgrades. Additional filters needs to be applied to tune environment specific false positives.
1514
references:
1615
- https://dmcxblue.gitbook.io/red-team-notes-2-0/red-team-techniques/privilege-escalation/untitled-3/accessibility-features
1716
drilldown_searches:
@@ -32,9 +31,9 @@ tags:
3231
- Windows Persistence Techniques
3332
- Data Destruction
3433
asset_type: Endpoint
35-
confidence: 100
36-
impact: 80
37-
message: Registry path $registry_path$ was modified, added, or deleted in $dest$.
34+
confidence: 50
35+
impact: 50
36+
message: Default file association for $registry_path$ was modified to $registry_value_data$ in $dest$.
3837
mitre_attack_id:
3938
- T1546.001
4039
- T1546
@@ -58,7 +57,7 @@ tags:
5857
- Registry.registry_path
5958
- Registry.registry_key_name
6059
- Registry.registry_value_name
61-
risk_score: 80
60+
risk_score: 25
6261
security_domain: endpoint
6362
tests:
6463
- name: True Positive Test

0 commit comments

Comments
 (0)