From 5841d0fcb8993a58f8adad514c37039fe872dfe7 Mon Sep 17 00:00:00 2001 From: patel-bhavin Date: Wed, 8 Dec 2021 17:05:32 -0800 Subject: [PATCH 1/3] first draft --- .../disable_defender_antivirus_registry.yml | 10 +-- ...___disable_defender_antivirus_registry.yml | 66 +++++++++++++++++++ ...sable_defender_antivirus_registry.test.yml | 15 +++++ 3 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 detections/endpoint/ssa___disable_defender_antivirus_registry.yml create mode 100644 tests/endpoint/ssa___disable_defender_antivirus_registry.test.yml diff --git a/detections/endpoint/disable_defender_antivirus_registry.yml b/detections/endpoint/disable_defender_antivirus_registry.yml index 64c22443d4..bc365d77ff 100644 --- a/detections/endpoint/disable_defender_antivirus_registry.yml +++ b/detections/endpoint/disable_defender_antivirus_registry.yml @@ -12,11 +12,11 @@ description: This particular behavior is typically executed when an adversaries task modifications will occur. During triage, review parallel processes and identify any further file modifications. Endpoint should be isolated. search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) - as lastTime from datamodel=Endpoint.Registry where Registry.registry_path = "*\\Policies\\Microsoft\\Windows - Defender*" Registry.registry_value_name = DisableAntiVirus Registry.registry_value_data - = 0x00000001 by Registry.dest Registry.user Registry.registry_path Registry.registry_value_name - Registry.registry_value_data | `drop_dm_object_name(Registry)` | `security_content_ctime(lastTime)` - | `security_content_ctime(firstTime)` | `disable_defender_antivirus_registry_filter`' + as lastTime from datamodel=Endpoint.Registry where Registry.registry_path = "*\\Policies\\Microsoft\\Windows Defender*" Registry.registry_key_name = DisableAntiVirus Registry.registry_value_name="DWORD (0x00000001)" by Registry.dest Registry.user Registry.registry_path Registry.registry_value_name Registry.registry_value_data +| `drop_dm_object_name(Registry)` +| `security_content_ctime(lastTime)` +| `security_content_ctime(firstTime)` +| `disable_defender_antivirus_registry_filter`' how_to_implement: To successfully implement this search, you need to be ingesting logs with the registry value name, registry path, and registry value data from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the diff --git a/detections/endpoint/ssa___disable_defender_antivirus_registry.yml b/detections/endpoint/ssa___disable_defender_antivirus_registry.yml new file mode 100644 index 0000000000..91bca56165 --- /dev/null +++ b/detections/endpoint/ssa___disable_defender_antivirus_registry.yml @@ -0,0 +1,66 @@ +name: Disable Defender AntiVirus Registry +id: aa4f115a-3024-11ec-9987-acde48001122 +version: 1 +date: '2021-12-08' +author: Bhavin Patel, Splunk +type: TTP +datamodel: +- Endpoint +description: This particular behavior is typically executed when an adversaries or + malware gains access to an endpoint and beings to perform execution and to evade + detections. Usually, a batch (.bat) will be executed and multiple registry and scheduled + task modifications will occur. During triage, review parallel processes and identify + any further file modifications. Endpoint should be isolated. +search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) + as lastTime from datamodel=Endpoint.Registry where Registry.registry_path = "*\\Policies\\Microsoft\\Windows + Defender*" Registry.registry_value_name = DisableAntiVirus Registry.registry_value_data + = 0x00000001 by Registry.dest Registry.user Registry.registry_path Registry.registry_value_name + Registry.registry_value_data | `drop_dm_object_name(Registry)` | `security_content_ctime(lastTime)` + | `security_content_ctime(firstTime)` | `disable_defender_antivirus_registry_filter`' +how_to_implement: To successfully implement this search, you need to be ingesting + logs with the registry value name, registry path, and registry value data from your + endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the + Sysmon TA. +known_false_positives: admin or user may choose to disable windows defender product +references: +- https://thedfirreport.com/2021/10/18/icedid-to-xinglocker-ransomware-in-24-hours/ +tags: + analytic_story: + - IceID + automated_detection_testing: passed + confidence: 70 + context: + - Source:Endpoint + - Stage:Defense Evasion + dataset: + - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/icedid/disable_av/sysmon.log + impact: 70 + kill_chain_phases: + - Exploitation + message: modified/added/deleted registry entry $registry_path$ in $dest$ + mitre_attack_id: + - T1562.001 + - T1562 + observable: + - name: dest + type: Hostname + role: + - Victim + - name: user + type: user + role: + - Victim + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + required_fields: + - _time + - Registry.dest + - Registry.user + - Registry.registry_value_name + - Registry.registry_key_name + - Registry.registry_path + - Registry.registry_value_data + risk_score: 49 + security_domain: endpoint diff --git a/tests/endpoint/ssa___disable_defender_antivirus_registry.test.yml b/tests/endpoint/ssa___disable_defender_antivirus_registry.test.yml new file mode 100644 index 0000000000..7c2d37bbf5 --- /dev/null +++ b/tests/endpoint/ssa___disable_defender_antivirus_registry.test.yml @@ -0,0 +1,15 @@ +name: Disable Defender AntiVirus Registry Unit Test - SSA +tests: + - name: Disable Defender AntiVirus Registry + file: endpoint/ssa___disable_defender_antivirus_registry.yml + pass_condition: '@count_gt(0)' + description: Test for Disable Defender AntiVirus Registry + attack_data: + - file_name: sysmon.log + data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/icedid/disable_av/sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: xmlwineventlog + + + + From 9a5c2f62362883a6f5b975981144dfa1d442f1dc Mon Sep 17 00:00:00 2001 From: patel-bhavin Date: Wed, 8 Dec 2021 17:22:31 -0800 Subject: [PATCH 2/3] datamodel --- ...___disable_defender_antivirus_registry.yml | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/detections/endpoint/ssa___disable_defender_antivirus_registry.yml b/detections/endpoint/ssa___disable_defender_antivirus_registry.yml index 91bca56165..d63cd977fa 100644 --- a/detections/endpoint/ssa___disable_defender_antivirus_registry.yml +++ b/detections/endpoint/ssa___disable_defender_antivirus_registry.yml @@ -5,23 +5,34 @@ date: '2021-12-08' author: Bhavin Patel, Splunk type: TTP datamodel: -- Endpoint +- Endpoint_Registry description: This particular behavior is typically executed when an adversaries or malware gains access to an endpoint and beings to perform execution and to evade detections. Usually, a batch (.bat) will be executed and multiple registry and scheduled task modifications will occur. During triage, review parallel processes and identify any further file modifications. Endpoint should be isolated. -search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) - as lastTime from datamodel=Endpoint.Registry where Registry.registry_path = "*\\Policies\\Microsoft\\Windows - Defender*" Registry.registry_value_name = DisableAntiVirus Registry.registry_value_data - = 0x00000001 by Registry.dest Registry.user Registry.registry_path Registry.registry_value_name - Registry.registry_value_data | `drop_dm_object_name(Registry)` | `security_content_ctime(lastTime)` - | `security_content_ctime(firstTime)` | `disable_defender_antivirus_registry_filter`' +search: '| from read_ssa_enriched_events() +| eval timestamp=parse_long(ucast(map_get(input_event,"_time"), + "string", null)), registry_path=lower(ucast(map_get(input_event, "registry_path"), "string", + null)), registry_key_name=lower(ucast(map_get(input_event, "registry_key_name"), "string", + null)), registry_value_data=ucast(map_get(input_event, "registry_value_data"), "string", null), + process_guid=ucast(map_get(input_event, "process_guid"), "string", + null), + event_id=ucast(map_get(input_event, "event_id"), "string", null) +| where like(registry_path, "%\\Policies\\Microsoft\\Windows Defender%") + AND registry_key_name="DisableAntiVirus" AND registry_value_data="(0x00000001)" +| eval start_time=timestamp, + end_time=timestamp, entities=mvappend(ucast(map_get(input_event, "dest_user_id"), + "string", null), ucast(map_get(input_event, "dest_device_id"), "string", null)), + body=create_map( + [ "event_id", event_id, "registry_path", registry_path, "registry_key_name", + registry_key_name, "process_guid", process_guid,"registry_value_data",registry_value_data]) +| into write_ssa_detected_events();' how_to_implement: To successfully implement this search, you need to be ingesting logs with the registry value name, registry path, and registry value data from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA. -known_false_positives: admin or user may choose to disable windows defender product +known_false_positives: Admin or user may choose to disable windows defender product references: - https://thedfirreport.com/2021/10/18/icedid-to-xinglocker-ransomware-in-24-hours/ tags: @@ -37,7 +48,7 @@ tags: impact: 70 kill_chain_phases: - Exploitation - message: modified/added/deleted registry entry $registry_path$ in $dest$ + message: Modified/added/deleted registry entry $registry_path$ in $dest$ mitre_attack_id: - T1562.001 - T1562 @@ -51,9 +62,7 @@ tags: role: - Victim product: - - Splunk Enterprise - - Splunk Enterprise Security - - Splunk Cloud + - Splunk Behavioral Analytics required_fields: - _time - Registry.dest From cca42c0009295cda7189b9bfb5b9838b2d643323 Mon Sep 17 00:00:00 2001 From: patel-bhavin Date: Mon, 24 Jan 2022 15:31:15 -0800 Subject: [PATCH 3/3] moving to expermental --- .../ssa___disable_defender_antivirus_registry.yml | 0 .../endpoint/ssa___disable_defender_antivirus_registry.test.yml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename detections/{endpoint => experimental}/ssa___disable_defender_antivirus_registry.yml (100%) rename tests/{ => experimental}/endpoint/ssa___disable_defender_antivirus_registry.test.yml (100%) diff --git a/detections/endpoint/ssa___disable_defender_antivirus_registry.yml b/detections/experimental/ssa___disable_defender_antivirus_registry.yml similarity index 100% rename from detections/endpoint/ssa___disable_defender_antivirus_registry.yml rename to detections/experimental/ssa___disable_defender_antivirus_registry.yml diff --git a/tests/endpoint/ssa___disable_defender_antivirus_registry.test.yml b/tests/experimental/endpoint/ssa___disable_defender_antivirus_registry.test.yml similarity index 100% rename from tests/endpoint/ssa___disable_defender_antivirus_registry.test.yml rename to tests/experimental/endpoint/ssa___disable_defender_antivirus_registry.test.yml