Detection rules › Sigma

Suspicious Scheduled Task Update

Status
test
Severity
high
Log source
product windows, service security
Author
Nasreddine Bencherchali (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects update to a scheduled task event that contain suspicious keywords.

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
Security-AuditingEvent ID 4702A scheduled task was updated.

Rule body yaml

title: Suspicious Scheduled Task Update
id: 614cf376-6651-47c4-9dcc-6b9527f749f4
related:
    - id: 1c0e41cd-21bb-4433-9acc-4a2cd6367b9b # ProcCreation schtasks change
      type: similar
status: test
description: Detects update to a scheduled task event that contain suspicious keywords.
references:
    - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4698
author: Nasreddine Bencherchali (Nextron Systems)
date: 2022-12-05
tags:
    - attack.execution
    - attack.privilege-escalation
    - attack.persistence
    - attack.t1053.005
logsource:
    product: windows
    service: security
    definition: 'The Advanced Audit Policy setting Object Access > Audit Other Object Access Events has to be configured to allow this detection. We also recommend extracting the Command field from the embedded XML in the event data.'
detection:
    selection_eid:
        EventID: 4702
    selection_paths:
        TaskContentNew|contains:
            - '\AppData\Local\Temp\'
            - '\AppData\Roaming\'
            - '\Users\Public\'
            - '\WINDOWS\Temp\'
            - 'C:\Temp\'
            - '\Desktop\'
            - '\Downloads\'
            - '\Temporary Internet'
            - 'C:\ProgramData\'
            - 'C:\Perflogs\'
    selection_commands:
        TaskContentNew|contains:
            - 'regsvr32'
            - 'rundll32'
            - 'cmd.exe</Command>'
            - 'cmd</Command>'
            - '<Arguments>/c '
            - '<Arguments>/k '
            - '<Arguments>/r '
            - 'powershell'
            - 'pwsh'
            - 'mshta'
            - 'wscript'
            - 'cscript'
            - 'certutil'
            - 'bitsadmin'
            - 'bash.exe'
            - 'bash '
            - 'scrcons'
            - 'wmic '
            - 'wmic.exe'
            - 'forfiles'
            - 'scriptrunner'
            - 'hh.exe'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_eid

selection_eid:
    EventID: 4702

Stage 2: selection_paths

selection_paths:
    TaskContentNew|contains:
        - '\AppData\Local\Temp\'
        - '\AppData\Roaming\'
        - '\Users\Public\'
        - '\WINDOWS\Temp\'
        - 'C:\Temp\'
        - '\Desktop\'
        - '\Downloads\'
        - '\Temporary Internet'
        - 'C:\ProgramData\'
        - 'C:\Perflogs\'

Stage 3: selection_commands

selection_commands:
    TaskContentNew|contains:
        - 'regsvr32'
        - 'rundll32'
        - 'cmd.exe</Command>'
        - 'cmd</Command>'
        - '<Arguments>/c '
        - '<Arguments>/k '
        - '<Arguments>/r '
        - 'powershell'
        - 'pwsh'
        - 'mshta'
        - 'wscript'
        - 'cscript'
        - 'certutil'
        - 'bitsadmin'
        - 'bash.exe'
        - 'bash '
        - 'scrcons'
        - 'wmic '
        - 'wmic.exe'
        - 'forfiles'
        - 'scriptrunner'
        - 'hh.exe'

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
TaskContentNewmatch
  • <Arguments>/c
  • <Arguments>/k
  • <Arguments>/r
  • C:\Perflogs\
  • C:\ProgramData\
  • C:\Temp\
  • \AppData\Local\Temp\
  • \AppData\Roaming\
  • \Desktop\
  • \Downloads\
  • \Temporary Internet
  • \Users\Public\
  • \WINDOWS\Temp\
  • bash
  • bash.exe
  • bitsadmin
  • certutil
  • cmd.exe</Command>
  • cmd</Command>
  • cscript
  • forfiles
  • hh.exe
  • mshta
  • powershell
  • pwsh
  • regsvr32
  • rundll32
  • scrcons
  • scriptrunner
  • wmic
  • wmic.exe
  • wscript