Detection rules › Sigma

Scheduled Task Creation From Potential Suspicious Parent Location

Status
test
Severity
medium
Log source
category process_creation, product windows
Author
Florian Roth (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects the execution of "schtasks.exe" from a parent that is located in a potentially suspicious location. Multiple malware strains were seen exhibiting a similar behavior in order to achieve persistence.

Known false positives

  • Software installers that run from temporary folders and also install scheduled tasks

MITRE ATT&CK coverage

Telemetry coverage

Rule body

title: Scheduled Task Creation From Potential Suspicious Parent Location
id: 9494479d-d994-40bf-a8b1-eea890237021
status: test
description: |
    Detects the execution of "schtasks.exe" from a parent that is located in a potentially suspicious location.
    Multiple malware strains were seen exhibiting a similar behavior in order to achieve persistence.
references:
    - https://app.any.run/tasks/649e7b46-9bec-4d05-98a5-dfa9a13eaae5/
author: Florian Roth (Nextron Systems)
date: 2022-02-23
modified: 2024-05-13
tags:
    - attack.execution
    - attack.persistence
    - attack.privilege-escalation
    - attack.t1053.005
    - detection.threat-hunting
logsource:
    product: windows
    category: process_creation
detection:
    selection:
        ParentImage|contains:
            - ':\Temp\'
            - '\AppData\Local\'
            - '\AppData\Roaming\'
            - '\Temporary Internet'
            - '\Users\Public\'
            - '\Windows\Temp\'
        Image|endswith: '\schtasks.exe'
        CommandLine|contains: '/Create '
    filter_optional_common:
        CommandLine|contains:
            - 'update_task.xml'
            - 'unattended.ini'
    condition: selection and not 1 of filter_optional_*
falsepositives:
    - Software installers that run from temporary folders and also install scheduled tasks
level: medium

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_optional_*

Stage 1: selection

selection:
    ParentImage|contains:
        - ':\Temp\'
        - '\AppData\Local\'
        - '\AppData\Roaming\'
        - '\Temporary Internet'
        - '\Users\Public\'
        - '\Windows\Temp\'
    Image|endswith: '\schtasks.exe'
    CommandLine|contains: '/Create '

Stage 2: not filter_optional_common

filter_optional_common:
    CommandLine|contains:
        - 'update_task.xml'
        - 'unattended.ini'

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
CommandLinematchunattended.iniexcludes:CommandLine field:"CommandLine" value:"unattended.ini"
CommandLinematchupdate_task.xmlexcludes:CommandLine field:"CommandLine" value:"update_task.xml"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLinematch
  • /Create corpus 5 (sigma 3, splunk 2)
field:"CommandLine" kind:match value:"/Create "
Imageends_with
  • \schtasks.exe corpus 55 (sigma 55)
field:"Image" kind:ends_with value:"\schtasks.exe"
ParentImagematch
  • :\Temp\
  • \AppData\Local\ corpus 2 (sigma 2)
  • \AppData\Roaming\ corpus 2 (sigma 2)
  • \Temporary Internet corpus 2 (sigma 2)
  • \Users\Public\ corpus 2 (sigma 2)
  • \Windows\Temp\ corpus 2 (sigma 2)
field:"ParentImage" kind:match