From b4e4c1385fb04b35cd5530568357f358cedfc551 Mon Sep 17 00:00:00 2001 From: P4T12ICK Date: Wed, 24 Nov 2021 11:33:10 +0100 Subject: [PATCH] ssa test ci cd --- .../modules/data/windows-security_debug.txt | 123 ++++++++++++++++++ .../modules/test_ssa_detections.py | 2 +- bin/ssa-end-to-end-testing/modules/utils.py | 2 + 3 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 bin/ssa-end-to-end-testing/modules/data/windows-security_debug.txt diff --git a/bin/ssa-end-to-end-testing/modules/data/windows-security_debug.txt b/bin/ssa-end-to-end-testing/modules/data/windows-security_debug.txt new file mode 100644 index 0000000000..b3d7abb2a7 --- /dev/null +++ b/bin/ssa-end-to-end-testing/modules/data/windows-security_debug.txt @@ -0,0 +1,123 @@ +11/24/2021 2:28:14 AM +LogName=Security +SourceName=Microsoft Windows security auditing. +EventCode=4688 +EventType=0 +Type=Information +ComputerName=win-dc-725.attackrange.local +TaskCategory=Process Creation +OpCode=Info +RecordNumber=257876 +Keywords=Audit Success +Message=A new process has been created. + +Creator Subject: + Security ID: ATTACKRANGE\Administrator + Account Name: Administrator + Account Domain: ATTACKRANGE + Logon ID: 0x55E621 + +Target Subject: + Security ID: NULL SID + Account Name: - + Account Domain: - + Logon ID: 0x0 + +Process Information: + New Process ID: 0xca4 + New Process Name: C:\Windows\System32\cmd.exe + Token Elevation Type: %%1936 + Mandatory Label: Mandatory Label\High Mandatory Level + Creator Process ID: 0x13a4 + Creator Process Name: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe + Process Command Line: "C:\Windows\system32\cmd.exe" /c "pypykatz live registry" + +Token Elevation Type indicates the type of token that was assigned to the new process in accordance with User Account Control policy. + +Type 1 is a full token with no privileges removed or groups disabled. A full token is only used if User Account Control is disabled or if the user is the built-in Administrator account or a service account. + +Type 2 is an elevated token with no privileges removed or groups disabled. An elevated token is used when User Account Control is enabled and the user chooses to start the program using Run as administrator. An elevated token is also used when an application is configured to always require administrative privilege or to always require maximum privilege, and the user is a member of the Administrators group. + +Type 3 is a limited token with administrative privileges removed and administrative groups disabled. The limited token is used when User Account Control is enabled, the application does not require administrative privilege, and the user does not choose to start the program using Run as administrator. +11/24/2021 2:28:15 AM +LogName=Security +SourceName=Microsoft Windows security auditing. +EventCode=4688 +EventType=0 +Type=Information +ComputerName=win-dc-725.attackrange.local +TaskCategory=Process Creation +OpCode=Info +RecordNumber=257875 +Keywords=Audit Success +Message=A new process has been created. + +Creator Subject: + Security ID: ATTACKRANGE\Administrator + Account Name: Administrator + Account Domain: ATTACKRANGE + Logon ID: 0x55E621 + +Target Subject: + Security ID: NULL SID + Account Name: - + Account Domain: - + Logon ID: 0x0 + +Process Information: + New Process ID: 0x62c + New Process Name: C:\Windows\System32\reg.exe + Token Elevation Type: %%1936 + Mandatory Label: Mandatory Label\High Mandatory Level + Creator Process ID: 0xf6c + Creator Process Name: C:\Windows\System32\cmd.exe + Process Command Line: reg save HKLM\security C:\Users\ADMINI~1\AppData\Local\Temp\security + +Token Elevation Type indicates the type of token that was assigned to the new process in accordance with User Account Control policy. + +Type 1 is a full token with no privileges removed or groups disabled. A full token is only used if User Account Control is disabled or if the user is the built-in Administrator account or a service account. + +Type 2 is an elevated token with no privileges removed or groups disabled. An elevated token is used when User Account Control is enabled and the user chooses to start the program using Run as administrator. An elevated token is also used when an application is configured to always require administrative privilege or to always require maximum privilege, and the user is a member of the Administrators group. + +Type 3 is a limited token with administrative privileges removed and administrative groups disabled. The limited token is used when User Account Control is enabled, the application does not require administrative privilege, and the user does not choose to start the program using Run as administrator. +11/24/2021 2:28:16 AM +LogName=Security +SourceName=Microsoft Windows security auditing. +EventCode=4688 +EventType=0 +Type=Information +ComputerName=win-dc-725.attackrange.local +TaskCategory=Process Creation +OpCode=Info +RecordNumber=257874 +Keywords=Audit Success +Message=A new process has been created. + +Creator Subject: + Security ID: ATTACKRANGE\Administrator + Account Name: Administrator + Account Domain: ATTACKRANGE + Logon ID: 0x55E621 + +Target Subject: + Security ID: NULL SID + Account Name: - + Account Domain: - + Logon ID: 0x0 + +Process Information: + New Process ID: 0x1258 + New Process Name: C:\Windows\System32\reg.exe + Token Elevation Type: %%1936 + Mandatory Label: Mandatory Label\High Mandatory Level + Creator Process ID: 0xf6c + Creator Process Name: C:\Windows\System32\cmd.exe + Process Command Line: reg save HKLM\system C:\Users\ADMINI~1\AppData\Local\Temp\system + +Token Elevation Type indicates the type of token that was assigned to the new process in accordance with User Account Control policy. + +Type 1 is a full token with no privileges removed or groups disabled. A full token is only used if User Account Control is disabled or if the user is the built-in Administrator account or a service account. + +Type 2 is an elevated token with no privileges removed or groups disabled. An elevated token is used when User Account Control is enabled and the user chooses to start the program using Run as administrator. An elevated token is also used when an application is configured to always require administrative privilege or to always require maximum privilege, and the user is a member of the Administrators group. + +Type 3 is a limited token with administrative privileges removed and administrative groups disabled. The limited token is used when User Account Control is enabled, the application does not require administrative privilege, and the user does not choose to start the program using Run as administrator. diff --git a/bin/ssa-end-to-end-testing/modules/test_ssa_detections.py b/bin/ssa-end-to-end-testing/modules/test_ssa_detections.py index 1c7d8992e3..1c21291c7a 100644 --- a/bin/ssa-end-to-end-testing/modules/test_ssa_detections.py +++ b/bin/ssa-end-to-end-testing/modules/test_ssa_detections.py @@ -20,7 +20,7 @@ SLEEP_TIME_SEND_DATA = 30 WAIT_CYCLE = 20 MAX_EXECUTION_TIME_LIMIT = 600 # per detection test -TEST_DATASET = 'windows-security_small.txt' +TEST_DATASET = 'windows-security_debug.txt' class SSADetectionTesting: diff --git a/bin/ssa-end-to-end-testing/modules/utils.py b/bin/ssa-end-to-end-testing/modules/utils.py index 14111281e8..3b94c22bb5 100644 --- a/bin/ssa-end-to-end-testing/modules/utils.py +++ b/bin/ssa-end-to-end-testing/modules/utils.py @@ -126,6 +126,8 @@ def read_data(file_path): if i == count and tmp_counter > 10: data.append(event) + print("data parsed into individual events:") + print(data) return data