This commit is contained in:
P4T12ICK
2020-10-08 13:01:52 +02:00
parent c03d944d3e
commit f81abbc79d
3 changed files with 15 additions and 8 deletions
@@ -113,6 +113,9 @@ def main(args):
# delete ssh key
response = ec2.delete_key_pair(KeyName=ssh_key_name)
# read_test_file
test_file = load_file('security-content/tests/' + test_file_name + '.yml')
# check if was succesful
if not execution_error:
@@ -133,6 +136,12 @@ def main(args):
file_path = 'security-content/detections/' + test['detection'].replace(' ', '_').replace('-','_').replace('.','_').replace('/','_').lower() + '.yml'
detection_obj = load_file(file_path)
detection_obj['tags']['automated_detection_testing'] = 'passed'
if 'attack_data' in test_file:
datasets = []
for dataset in detection_test['attack_data']:
datasets.append(dataset['data'])
detection_obj['tags']['dataset'] = datasets
with open(file_path, 'w') as f:
yaml.dump(detection_obj, f)
@@ -14,8 +14,7 @@ author: Patrick Bareiss, Splunk
search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time)
as lastTime from datamodel=Endpoint.Processes where (Processes.process_name=reg.exe
OR Processes.process_name=cmd.exe) Processes.process=*save* (Processes.process=*HKEY_LOCAL_MACHINE\\Security*
OR Processes.process=*HKEY_LOCAL_MACHINE\\SAM* OR Processes.process=*HKEY_LOCAL_MACHINE\\System*
OR Processes.process=*HKLM\\Security* OR Processes.process=*HKLM\\System* OR Processes.process=*HKLM\\SAM*)
OR Processes.process=*HKEY_LOCAL_MACHINE\\SAM* OR Processes.process=*HKEY_LOCAL_MACHINE\\System*)
by Processes.user Processes.process_name Processes.process Processes.dest | `drop_dm_object_name(Processes)`
| `security_content_ctime(firstTime)`| `security_content_ctime(lastTime)` | `attempted_credential_dump_from_registry_via_reg_exe_filter` '
known_false_positives: None identified.
@@ -34,4 +33,3 @@ tags:
- DE.CM
security_domain: endpoint
asset_type: Endpoint
+5 -5
View File
@@ -2,11 +2,11 @@ name: Credential Dumping sam test
detections:
- name: Attempted Credential Dump From Registry via Reg exe
pass_condition: '| stats count | where count > 0'
attack_data:
- file_name: windows-sysmon.log
data: https://attack-range-attack-data.s3-us-west-2.amazonaws.com/T1003.002/windows-sysmon.log
source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
sourcetype: xmlwineventlog
description: Test credential dumping detections
target: default-attack-range-windows-domain-controller
simulation_technique: 'T1003.002'
attack_data:
- file_name: windows-sysmon.log
data: https://attack-range-attack-data.s3-us-west-2.amazonaws.com/T1003.002/windows-sysmon.log
source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
sourcetype: xmlwineventlog