Detection rules › Sigma

Schtasks From Suspicious Folders

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

Detects scheduled task creations that have suspicious action command and folder combinations

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Schtasks From Suspicious Folders
id: 8a8379b8-780b-4dbf-b1e9-31c8d112fefb
status: test
description: Detects scheduled task creations that have suspicious action command and folder combinations
references:
    - https://symantec-enterprise-blogs.security.com/blogs/threat-intelligence/lazarus-dream-job-chemical
author: Florian Roth (Nextron Systems)
date: 2022-04-15
modified: 2022-11-18
tags:
    - attack.privilege-escalation
    - attack.persistence
    - attack.execution
    - attack.t1053.005
logsource:
    product: windows
    category: process_creation
detection:
    selection_img:
        - Image|endswith: '\schtasks.exe'
        - OriginalFileName: 'schtasks.exe'
    selection_create:
        CommandLine|contains: ' /create '
    selection_command:
        CommandLine|contains:
            - 'powershell'
            - 'pwsh'
            - 'cmd /c '
            - 'cmd /k '
            - 'cmd /r '
            - 'cmd.exe /c '
            - 'cmd.exe /k '
            - 'cmd.exe /r '
    selection_all_folders:
        CommandLine|contains:
            - 'C:\ProgramData\'
            - '%ProgramData%'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_img

selection_img:
    - Image|endswith: '\schtasks.exe'
    - OriginalFileName: 'schtasks.exe'

Stage 2: selection_create

selection_create:
    CommandLine|contains: ' /create '

Stage 3: selection_command

selection_command:
    CommandLine|contains:
        - 'powershell'
        - 'pwsh'
        - 'cmd /c '
        - 'cmd /k '
        - 'cmd /r '
        - 'cmd.exe /c '
        - 'cmd.exe /k '
        - 'cmd.exe /r '

Stage 4: selection_all_folders

selection_all_folders:
    CommandLine|contains:
        - 'C:\ProgramData\'
        - '%ProgramData%'

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
  • /create corpus 15 (sigma 15)
  • %ProgramData% corpus 4 (sigma 4)
  • C:\ProgramData\ corpus 6 (sigma 6)
  • cmd /c corpus 4 (sigma 4)
  • cmd /k corpus 4 (sigma 4)
  • cmd /r corpus 4 (sigma 4)
  • cmd.exe /c corpus 6 (sigma 6)
  • cmd.exe /k corpus 5 (sigma 5)
  • cmd.exe /r corpus 5 (sigma 5)
  • powershell corpus 25 (sigma 24, chronicle 1)
  • pwsh corpus 7 (sigma 7)
Imageends_with
  • \schtasks.exe corpus 56 (sigma 56)
OriginalFileNameeq
  • schtasks.exe corpus 23 (sigma 18, splunk 4, elastic 1)