Detection rules › Sigma

Suspicious Modification Of Scheduled Tasks

Severity
high
Author
Nasreddine Bencherchali (Nextron Systems)
Source
upstream

Detects when an attacker tries to modify an already existing scheduled tasks to run from a suspicious location Attackers can create a simple looking task in order to avoid detection on creation as it's often the most focused on Instead they modify the task after creation to include their malicious payload

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
Sysmon1Process creation
Security-Auditing4688A new process has been created.

Stages and Predicates

Stage 1: all of selection_schtasks

CommandLine|contains: ' /Change '
CommandLine|contains: ' /TN '
Image|endswith: '\schtasks.exe'

Stage 2: all of selection_susp_locations

or:
CommandLine|contains: '%ProgramData%'
CommandLine|contains: '%appdata%'
CommandLine|contains: '%comspec%'
CommandLine|contains: '%localappdata%'
CommandLine|contains: 'C:\Perflogs\'
CommandLine|contains: 'C:\ProgramData\'
CommandLine|contains: '\AppData\Local\Temp'
CommandLine|contains: '\AppData\Roaming\'
CommandLine|contains: '\Desktop\'
CommandLine|contains: '\Downloads\'
CommandLine|contains: '\Temporary Internet'
CommandLine|contains: '\Users\Public\'
CommandLine|contains: '\WINDOWS\Temp\'

Stage 3: all of selection_susp_images

or:
CommandLine|contains: 'bash '
CommandLine|contains: bash.exe
CommandLine|contains: bitsadmin
CommandLine|contains: certutil
CommandLine|contains: 'cmd /c '
CommandLine|contains: 'cmd /k '
CommandLine|contains: 'cmd /r '
CommandLine|contains: 'cmd.exe /c '
CommandLine|contains: 'cmd.exe /k '
CommandLine|contains: 'cmd.exe /r '
CommandLine|contains: cscript
CommandLine|contains: forfiles
CommandLine|contains: 'hh '
CommandLine|contains: hh.exe
CommandLine|contains: mshta
CommandLine|contains: powershell
CommandLine|contains: regsvr32
CommandLine|contains: rundll32
CommandLine|contains: scrcons
CommandLine|contains: scriptrunner
CommandLine|contains: 'wmic '
CommandLine|contains: wmic.exe
CommandLine|contains: wscript

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
CommandLinematch
  • /Change
  • /TN
  • %ProgramData% corpus 4 (sigma 4)
  • %appdata% corpus 4 (sigma 4)
  • %comspec% corpus 3 (sigma 3)
  • %localappdata% corpus 2 (sigma 2)
  • C:\Perflogs\
  • C:\ProgramData\ corpus 6 (sigma 6)
  • \AppData\Local\Temp corpus 8 (sigma 8)
  • \AppData\Roaming\ corpus 10 (sigma 10)
  • \Desktop\ corpus 11 (sigma 11)
  • \Downloads\ corpus 12 (sigma 12)
  • \Temporary Internet corpus 6 (sigma 6)
  • \Users\Public\ corpus 17 (sigma 17)
  • \WINDOWS\Temp\ corpus 2 (sigma 2)
  • bash
  • bash.exe
  • bitsadmin corpus 5 (sigma 5)
  • certutil corpus 5 (sigma 5)
  • cmd /c corpus 5 (sigma 5)
  • cmd /k corpus 5 (sigma 5)
  • cmd /r corpus 5 (sigma 5)
  • cmd.exe /c corpus 6 (sigma 6)
  • cmd.exe /k corpus 6 (sigma 6)
  • cmd.exe /r corpus 6 (sigma 6)
  • cscript corpus 12 (sigma 12)
  • forfiles corpus 2 (sigma 2)
  • hh
  • hh.exe
  • mshta corpus 11 (sigma 11)
  • powershell corpus 16 (sigma 16)
  • regsvr32 corpus 11 (sigma 11)
  • rundll32 corpus 19 (sigma 19)
  • scrcons
  • scriptrunner
  • wmic corpus 2 (sigma 2)
  • wmic.exe corpus 2 (sigma 2)
  • wscript corpus 12 (sigma 12)
Imageends_with
  • \schtasks.exe corpus 45 (sigma 45)