Detection rules › Sigma

Powershell Create Scheduled Task

Severity
medium
Author
frack113
Source
upstream

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

MITRE ATT&CK coverage

TacticTechniques
ExecutionT1053.005 Scheduled Task/Job: Scheduled Task
PersistenceT1053.005 Scheduled Task/Job: Scheduled Task
Privilege EscalationT1053.005 Scheduled Task/Job: Scheduled Task

Event coverage

ProviderEvent IDTitle
PowerShell4104Creating Scriptblock text (MessageNumber of MessageTotal).

Stages and Predicates

Stage 1: 1 of selection_cmdlet

or:
ScriptBlockText|contains: New-ScheduledTask
ScriptBlockText|contains: New-ScheduledTaskAction
ScriptBlockText|contains: New-ScheduledTaskPrincipal
ScriptBlockText|contains: New-ScheduledTaskSettingsSet
ScriptBlockText|contains: New-ScheduledTaskTrigger
ScriptBlockText|contains: Register-ScheduledTask

Stage 2: 1 of selection_cimmethod

ScriptBlockText|contains: -ClassName
ScriptBlockText|contains: -NameSpace
ScriptBlockText|contains: Invoke-CimMethod
ScriptBlockText|contains: PS_ScheduledTask
ScriptBlockText|contains: 'Root\Microsoft\Windows\TaskScheduler'

Stage 3: not 1 of filter_main_legitimate_scripts

ScriptBlockText|contains: 'Microsoft.Management.Infrastructure.CimInstance'
ScriptBlockText|contains: 'Microsoft.PowerShell.Core\Export-ModuleMember'
ScriptBlockText|contains: __cmdletization_methodParameter

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
ScriptBlockTextmatch
  • -ClassName
  • -NameSpace
  • Invoke-CimMethod
  • Microsoft.Management.Infrastructure.CimInstance
  • Microsoft.PowerShell.Core\Export-ModuleMember corpus 2 (sigma 2)
  • New-ScheduledTask
  • New-ScheduledTaskAction
  • New-ScheduledTaskPrincipal
  • New-ScheduledTaskSettingsSet
  • New-ScheduledTaskTrigger
  • PS_ScheduledTask
  • Register-ScheduledTask
  • Root\Microsoft\Windows\TaskScheduler
  • __cmdletization_methodParameter

Neighbors

Broader alternatives (more inclusive than this rule)

These rules match a superset of what this rule catches. They cover the same events plus more. Use them if you want wider coverage and can absorb more false positives.