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.privilege-escalation
13    - attack.execution
14    - attack.persistence
15    - attack.t1053.005
16logsource:
17    product: windows
18    category: ps_script
19    definition: 'Requirements: Script Block Logging must be enabled'
20detection:
21    selection_cmdlet:
22        ScriptBlockText|contains:
23            - 'New-ScheduledTaskAction'
24            - 'New-ScheduledTaskTrigger'
25            - 'New-ScheduledTaskPrincipal'
26            - 'New-ScheduledTaskSettingsSet'
27            - 'New-ScheduledTask'
28            - 'Register-ScheduledTask'
29    selection_cimmethod:
30        ScriptBlockText|contains|all:
31            - 'Invoke-CimMethod'
32            - '-ClassName'
33            - 'PS_ScheduledTask'
34            - '-NameSpace'
35            - 'Root\Microsoft\Windows\TaskScheduler'
36    filter_main_legitimate_scripts:
37        ScriptBlockText|contains|all:
38            - 'Microsoft.PowerShell.Core\Export-ModuleMember'
39            - 'Microsoft.Management.Infrastructure.CimInstance'
40            - '__cmdletization_methodParameter'
41    condition: 1 of selection_* and not 1 of filter_main_*
42falsepositives:
43    - Unknown
44level: medium

References

Related rules

to-top