From 3399bc4288baacceea48b1bde71d4e5d2a7f51f0 Mon Sep 17 00:00:00 2001 From: dluxtron <106139814+dluxtron@users.noreply.github.com> Date: Thu, 8 Sep 2022 20:45:45 +1000 Subject: [PATCH] Adding DSRM Account Changes --- detections/endpoint/dsrm_account_changes.yml | 77 ++++++++++++++++++++ detections/endpoint/dsrm_password_reset.yml | 2 +- tests/endpoint/dsrm_account_changes.test.yml | 13 ++++ 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 detections/endpoint/dsrm_account_changes.yml create mode 100644 tests/endpoint/dsrm_account_changes.test.yml diff --git a/detections/endpoint/dsrm_account_changes.yml b/detections/endpoint/dsrm_account_changes.yml new file mode 100644 index 0000000000..9294562e8d --- /dev/null +++ b/detections/endpoint/dsrm_account_changes.yml @@ -0,0 +1,77 @@ +name: DSRM Account Changes +id: 08cb291e-ea77-48e8-a95a-0799319bf056 +version: 1 +date: '2022-09-08' +author: Dean Luxton +type: TTP +datamodel: +- Endpoint +description: Aside from being used to promote genuine domain controllers, the DSRM (Directory Services Restore Mode) + account can be used to persist within a Domain. A DC can be configured to allow the DSRM account to logon & be + used in the same way as a local administrator account. This detection is looking for alterations to the behaviour + of the account via registry. +search: '| tstats `security_content_summariesonly` min(_time) as _time from datamodel=Endpoint.Registry + where Registry.registry_path= "*\\System\\CurrentControlSet\\Control\\Lsa\\DSRMAdminLogonBehavior" + Registry.registry_value_data IN ("*1","*2") by Registry.action Registry.registry_path + Registry.registry_value_data Registry.registry_value_type Registry.process_guid + | `drop_dm_object_name(Registry)` + | join type=outer process_guid [| tstats `security_content_summariesonly` count + FROM datamodel=Endpoint.Processes by Processes.user Processes.process_name Processes.process + Processes.dest Processes.parent_process_name Processes.parent_process Processes.process_guid + | `drop_dm_object_name(Processes)`] + | table _time action dest user parent_process_name parent_process process_name process + process_guid registry_path registry_value_data registry_value_type | `dsrm_account_changes_filter`' +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. +known_false_positives: Disaster recovery events. +references: +- https://adsecurity.org/?p=1714 +tags: + analytic_story: + - Domain Controller Attacks + - Windows Registry Abuse + - Windows Persistence Techniques + asset_type: Endpoint + cis20: + - CIS 3 + - CIS 5 + - CIS 16 + confidence: 100 + context: + - Source:Endpoint + - Stage:Persistence + dataset: + - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1098/dsrm_account/windows-security-xml.log + impact: 100 + kill_chain_phases: + - Actions on Objectives + message: DSRM Account Changes Initiated on $dest$ by $user$ + mitre_attack_id: + - T1098 + nist: + - DE.CM + observable: + - name: user + type: User + role: + - Victim + - name: dest + type: Hostname + role: + - Victim + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + required_fields: + - _time + - Registry.registry_value_data + - Registry.registry_path + - Registry.dest + - Registry.user + risk_score: 100 + security_domain: endpoint diff --git a/detections/endpoint/dsrm_password_reset.yml b/detections/endpoint/dsrm_password_reset.yml index eb29b0161f..4627c96c13 100644 --- a/detections/endpoint/dsrm_password_reset.yml +++ b/detections/endpoint/dsrm_password_reset.yml @@ -31,7 +31,7 @@ tags: confidence: 100 context: - Source:Endpoint - - Stage:Defense Evasion + - Stage:Persistence dataset: - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1098/dsrm_account/windows-security-xml.log impact: 100 diff --git a/tests/endpoint/dsrm_account_changes.test.yml b/tests/endpoint/dsrm_account_changes.test.yml new file mode 100644 index 0000000000..b4a3c000e9 --- /dev/null +++ b/tests/endpoint/dsrm_account_changes.test.yml @@ -0,0 +1,13 @@ +name: DSRM Account Changes Unit Test +tests: +- name: DSRM Account Changes + file: endpoint/dsrm_account_changes.yml + pass_condition: '| stats count | where count > 0' + earliest_time: -24h + latest_time: now + attack_data: + - file_name: windows-sysmon.log + data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1098/dsrm_account/windows-sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: xmlwineventlog + update_timestamp: true