cscli scenarios install sigmahq/proc_creation_win_schtasks_powershell_persistence1type: trigger2name: sigmahq/proc_creation_win_schtasks_powershell_persistence3description: |4 Detects suspicious powershell execution via a schedule task where the command ends with an suspicious flags to hide the powershell instance instead of executeing scripts or commands. This could be a sign of persistence via PowerShell "Get-Variable" technique as seen being used in Colibri Loader5filter: |6 (evt.Meta.service == 'sysmon' && evt.Parsed.EventID == '1') && (evt.Parsed.ParentImage == 'C:\\WINDOWS\\System32\\svchost.exe' && evt.Parsed.ParentCommandLine contains '-k netsvcs' && evt.Parsed.ParentCommandLine contains '-s Schedule' && (evt.Parsed.CommandLine endsWith ' -windowstyle hidden' || evt.Parsed.CommandLine endsWith ' -w hidden' || evt.Parsed.CommandLine endsWith ' -ep bypass' || evt.Parsed.CommandLine endsWith ' -noni'))7blackhole: 2m8#status: test9labels:10 service: windows11 confidence: 112 spoofable: 013 classification:14 - attack.t1053.00515 - attack.t1059.0011617 label: "Potential Persistence Via Powershell Search Order Hijacking - Task"18 behavior : "windows:audit"19 remediation: false2021scope:22 type: ParentProcessId23 expression: evt.Parsed.ParentProcessId2425