Detection rules › Sigma

Suspicious New Service Creation

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

Detects creation of a new service via "sc" command or the powershell "new-service" cmdlet with suspicious binary paths

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Suspicious New Service Creation
id: 17a1be64-8d88-40bf-b5ff-a4f7a50ebcc8
related:
    - id: 7fe71fc9-de3b-432a-8d57-8c809efc10ab
      type: derived
status: test
description: Detects creation of a new service via "sc" command or the powershell "new-service" cmdlet with suspicious binary paths
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: Nasreddine Bencherchali (Nextron Systems)
date: 2022-07-14
modified: 2022-11-18
tags:
    - attack.persistence
    - attack.privilege-escalation
    - attack.t1543.003
logsource:
    category: process_creation
    product: windows
detection:
    selection_sc:
        Image|endswith: '\sc.exe'
        CommandLine|contains|all:
            - 'create'
            - 'binPath='
    selection_posh:
        CommandLine|contains|all:
            - 'New-Service'
            - '-BinaryPathName'
    susp_binpath:
        CommandLine|contains:
            # Add more suspicious commands or binaries
            - 'powershell'
            - 'mshta'
            - 'wscript'
            - 'cscript'
            - 'svchost'
            - 'dllhost'
            - 'cmd '
            - 'cmd.exe /c'
            - 'cmd.exe /k'
            - 'cmd.exe /r'
            - 'rundll32'
            # Add more suspicious paths
            - 'C:\Users\Public'
            - '\Downloads\'
            - '\Desktop\'
            - '\Microsoft\Windows\Start Menu\Programs\Startup\'
            - 'C:\Windows\TEMP\'
            - '\AppData\Local\Temp'
    condition: 1 of selection* and susp_binpath
falsepositives:
    - Unlikely
level: high

Stages and Predicates

Stage 0: condition

1 of selection* and susp_binpath

Stage 1: selection_sc

selection_sc:
    Image|endswith: '\sc.exe'
    CommandLine|contains|all:
        - 'create'
        - 'binPath='

Stage 2: selection_posh

selection_posh:
    CommandLine|contains|all:
        - 'New-Service'
        - '-BinaryPathName'

Stage 3: susp_binpath

susp_binpath:
    CommandLine|contains:
        - 'powershell'
        - 'mshta'
        - 'wscript'
        - 'cscript'
        - 'svchost'
        - 'dllhost'
        - 'cmd '
        - 'cmd.exe /c'
        - 'cmd.exe /k'
        - 'cmd.exe /r'
        - 'rundll32'
        - '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
  • -BinaryPathName corpus 2 (sigma 2)
  • C:\Users\Public corpus 2 (sigma 2)
  • C:\Windows\TEMP\ corpus 7 (sigma 7)
  • New-Service corpus 2 (sigma 2)
  • \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 2 (sigma 2)
  • cmd corpus 2 (sigma 2)
  • cmd.exe /c corpus 3 (sigma 3)
  • cmd.exe /k corpus 3 (sigma 3)
  • cmd.exe /r corpus 3 (sigma 3)
  • create corpus 24 (sigma 17, splunk 7)
  • 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)