Powershell Create Scheduled Task

Adversaries may abuse the Windows Task Scheduler to perform task scheduling for initial or recurring execution of malicious code

Sigma rule (View on GitHub)

 1title: Powershell Create Scheduled Task
 2id: 363eccc0-279a-4ccf-a3ab-24c2e63b11fb
 3status: test
 4description: Adversaries may abuse the Windows Task Scheduler to perform task scheduling for initial or recurring execution of malicious code
 5references:
 6    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1053.005/T1053.005.md#atomic-test-4---powershell-cmdlet-scheduled-task
 7    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1053.005/T1053.005.md#atomic-test-6---wmi-invoke-cimmethod-scheduled-task
 8author: frack113
 9date: 2021-12-28
10modified: 2025-10-07
11tags:
12    - attack.persistence
13    - attack.t1053.005
14logsource:
15    product: windows
16    category: ps_script
17    definition: 'Requirements: Script Block Logging must be enabled'
18detection:
19    selection_cmdlet:
20        ScriptBlockText|contains:
21            - 'New-ScheduledTaskAction'
22            - 'New-ScheduledTaskTrigger'
23            - 'New-ScheduledTaskPrincipal'
24            - 'New-ScheduledTaskSettingsSet'
25            - 'New-ScheduledTask'
26            - 'Register-ScheduledTask'
27    selection_cimmethod:
28        ScriptBlockText|contains|all:
29            - 'Invoke-CimMethod'
30            - '-ClassName'
31            - 'PS_ScheduledTask'
32            - '-NameSpace'
33            - 'Root\Microsoft\Windows\TaskScheduler'
34    filter_main_legitimate_scripts:
35        ScriptBlockText|contains|all:
36            - 'Microsoft.PowerShell.Core\Export-ModuleMember'
37            - 'Microsoft.Management.Infrastructure.CimInstance'
38            - '__cmdletization_methodParameter'
39    condition: 1 of selection_* and not 1 of filter_main_*
40falsepositives:
41    - Unknown
42level: medium

References

Related rules

to-top