Detection rules › Sigma

Suspicious Schtasks Execution AppData Folder

Status
test
Severity
high
Log source
product windows, category process_creation
Author
pH-T (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects the creation of a schtask that executes a file from C:\Users<USER>\AppData\Local

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Suspicious Schtasks Execution AppData Folder
id: c5c00f49-b3f9-45a6-997e-cfdecc6e1967
status: test
description: 'Detects the creation of a schtask that executes a file from C:\Users\<USER>\AppData\Local'
references:
    - https://thedfirreport.com/2022/02/21/qbot-and-zerologon-lead-to-full-domain-compromise/
author: pH-T (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
date: 2022-03-15
modified: 2022-07-28
tags:
    - attack.privilege-escalation
    - attack.execution
    - attack.persistence
    - attack.t1053.005
    - attack.t1059.001
logsource:
    product: windows
    category: process_creation
detection:
    selection:
        Image|endswith: '\schtasks.exe'
        CommandLine|contains|all:
            - '/Create'
            - '/RU'
            - '/TR'
            - 'C:\Users\'
            - '\AppData\Local\'
        CommandLine|contains:
            - 'NT AUT' # This covers the usual NT AUTHORITY\SYSTEM
            - ' SYSTEM ' # SYSTEM is a valid value for schtasks hence it gets it's own value with space
    filter:
        # FP from test set in SIGMA
        ParentImage|contains|all:
            - '\AppData\Local\Temp\'
            - 'TeamViewer_.exe'
        Image|endswith: '\schtasks.exe'
        CommandLine|contains: '/TN TVInstallRestore'
    condition: selection and not filter
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

selection and not filter

Stage 1: selection

selection:
    Image|endswith: '\schtasks.exe'
    CommandLine|contains|all:
        - '/Create'
        - '/RU'
        - '/TR'
        - 'C:\Users\'
        - '\AppData\Local\'
    CommandLine|contains:
        - 'NT AUT'
        - ' SYSTEM '

Stage 2: not filter

filter:
    ParentImage|contains|all:
        - '\AppData\Local\Temp\'
        - 'TeamViewer_.exe'
    Image|endswith: '\schtasks.exe'
    CommandLine|contains: '/TN TVInstallRestore'

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
CommandLinematch/TN TVInstallRestore
Imageends_with\schtasks.exe
ParentImagematchTeamViewer_.exe
ParentImagematch\AppData\Local\Temp\

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
  • SYSTEM corpus 2 (sigma 2)
  • /Create corpus 9 (sigma 6, splunk 2, kusto 1)
  • /RU corpus 3 (sigma 3)
  • /TR
  • C:\Users\ corpus 7 (sigma 7)
  • NT AUT corpus 3 (sigma 3)
  • \AppData\Local\ corpus 10 (sigma 10)
Imageends_with
  • \schtasks.exe corpus 56 (sigma 56)