Detection rules › Sigma

Suspicious Service Path Modification

Status
test
Severity
high
Log source
product windows, category process_creation
Author
Victor Sergeev, oscd.community, Nasreddine Bencherchali (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects service path modification via the "sc" binary to a suspicious command or path

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Suspicious Service Path Modification
id: 138d3531-8793-4f50-a2cd-f291b2863d78
status: test
description: Detects service path modification via the "sc" binary to a suspicious command or path
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1543.003/T1543.003.md
    - https://web.archive.org/web/20180331144337/https://www.fireeye.com/blog/threat-research/2018/03/sanny-malware-delivery-method-updated-in-recently-observed-attacks.html
author: Victor Sergeev, oscd.community, Nasreddine Bencherchali (Nextron Systems)
date: 2019-10-21
modified: 2022-11-18
tags:
    - attack.persistence
    - attack.privilege-escalation
    - attack.t1543.003
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        Image|endswith: '\sc.exe'
        CommandLine|contains|all:
            - 'config'
            - 'binPath'
        CommandLine|contains:
            # Add more suspicious commands or binaries
            - 'powershell'
            - 'cmd '
            - 'mshta'
            - 'wscript'
            - 'cscript'
            - 'rundll32'
            - 'svchost'
            - 'dllhost'
            - 'cmd.exe /c'
            - 'cmd.exe /k'
            - 'cmd.exe /r'
            - 'cmd /c'
            - 'cmd /k'
            - 'cmd /r'
            # Add more suspicious paths
            - 'C:\Users\Public'
            - '\Downloads\'
            - '\Desktop\'
            - '\Microsoft\Windows\Start Menu\Programs\Startup\'
            - 'C:\Windows\TEMP\'
            - '\AppData\Local\Temp'
    condition: selection
falsepositives:
    - Unlikely
level: high

Stages and Predicates

Stage 0: condition

selection

Stage 1: selection

selection:
    Image|endswith: '\sc.exe'
    CommandLine|contains|all:
        - 'config'
        - 'binPath'
    CommandLine|contains:
        - 'powershell'
        - 'cmd '
        - 'mshta'
        - 'wscript'
        - 'cscript'
        - 'rundll32'
        - 'svchost'
        - 'dllhost'
        - 'cmd.exe /c'
        - 'cmd.exe /k'
        - 'cmd.exe /r'
        - 'cmd /c'
        - 'cmd /k'
        - 'cmd /r'
        - 'C:\Users\Public'
        - '\Downloads\'
        - '\Desktop\'
        - '\Microsoft\Windows\Start Menu\Programs\Startup\'
        - 'C:\Windows\TEMP\'
        - '\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
  • C:\Users\Public corpus 2 (sigma 2)
  • C:\Windows\TEMP\ corpus 7 (sigma 7)
  • \AppData\Local\Temp corpus 8 (sigma 8)
  • \Desktop\ corpus 13 (sigma 13)
  • \Downloads\ corpus 14 (sigma 14)
  • \Microsoft\Windows\Start Menu\Programs\Startup\ corpus 3 (sigma 3)
  • binPath corpus 6 (sigma 5, splunk 1)
  • cmd corpus 2 (sigma 2)
  • cmd /c corpus 5 (sigma 5)
  • cmd /k corpus 4 (sigma 4)
  • cmd /r corpus 3 (sigma 3)
  • cmd.exe /c corpus 3 (sigma 3)
  • cmd.exe /k corpus 3 (sigma 3)
  • cmd.exe /r corpus 3 (sigma 3)
  • config corpus 16 (sigma 15, splunk 1)
  • cscript corpus 15 (sigma 15)
  • dllhost corpus 2 (sigma 2)
  • mshta corpus 14 (sigma 14)
  • powershell corpus 25 (sigma 24, chronicle 1)
  • rundll32 corpus 26 (sigma 23, chronicle 2, kusto 1)
  • svchost corpus 2 (sigma 2)
  • wscript corpus 16 (sigma 16)
Imageends_with
  • \sc.exe corpus 30 (sigma 30)