From 905d6bf8fdf3bfe178a5dd78ae43a6c51e084971 Mon Sep 17 00:00:00 2001 From: Tim Shelton Date: Mon, 6 Dec 2021 22:02:54 +0000 Subject: [PATCH] Adding fp filter for ssm-document-worker --- .../win_powershell_cmdline_special_characters.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rules/windows/process_creation/win_powershell_cmdline_special_characters.yml b/rules/windows/process_creation/win_powershell_cmdline_special_characters.yml index f739a789d..bb18b360e 100644 --- a/rules/windows/process_creation/win_powershell_cmdline_special_characters.yml +++ b/rules/windows/process_creation/win_powershell_cmdline_special_characters.yml @@ -2,11 +2,11 @@ title: Suspicious PowerShell Command Line id: d7bcd677-645d-4691-a8d4-7a5602b780d1 status: test description: Detects the PowerShell command lines with special characters -author: Teymur Kheirkhabarov (idea), Vasiliy Burov (rule), oscd.community +author: Teymur Kheirkhabarov (idea), Vasiliy Burov (rule), oscd.community, Tim Shelton (fp) references: - https://speakerdeck.com/heirhabarov/hunting-for-powershell-abuse?slide=64 date: 2020/10/15 -modified: 2021/11/27 +modified: 2021/12/06 logsource: category: process_creation product: windows @@ -26,9 +26,13 @@ detection: selection5: Image|endswith: '\powershell.exe' CommandLine|re: '.*`.*`.*`.*`.*`.*' - condition: selection1 or selection2 or selection3 or selection4 or selection5 + filter: + ParentImage: + - C:\Program Files\Amazon\SSM\ssm-document-worker.exe + condition: (selection1 or selection2 or selection3 or selection4 or selection5) and not filter falsepositives: - Unlikely + - Amazon SSM Document Worker # fp example: powershell " [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 $keyExists = Test-Path "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\OC Manager\Subcomponents" $jsonObj = @() if ($keyExists) { $key = Get-Item "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\OC Manager\Subcomponents" $valueNames = $key.GetValueNames(); foreach ($valueName in $valueNames) { $value = $key.GetValue($valueName); if ($value -gt 0) { $installed = "True" } else { $installed = "False" } $jsonObj += @" {"Name": "$valueName", "Installed": "$installed"} "@ } } $result = $jsonObj -join "," $result = "[" + $result + "]" [Console]::WriteLine($result) level: high tags: - attack.defense_evasion