Detection rules › Sigma

Service StartupType Change Via PowerShell Set-Service

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

Detects the use of the PowerShell "Set-Service" cmdlet to change the startup type of a service to "disabled" or "manual"

Known false positives

  • False positives may occur with troubleshooting scripts

MITRE ATT&CK coverage

TacticTechniques
Defense Impairment

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

title: Service StartupType Change Via PowerShell Set-Service
id: 62b20d44-1546-4e61-afce-8e175eb9473c
status: test
description: Detects the use of the PowerShell "Set-Service" cmdlet to change the startup type of a service to "disabled" or "manual"
references:
    - https://www.virustotal.com/gui/file/38283b775552da8981452941ea74191aa0d203edd3f61fb2dee7b0aea3514955
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-03-04
tags:
    - attack.execution
    - attack.defense-impairment
    - attack.t1685
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\powershell.exe'
        - OriginalFileName: 'PowerShell.EXE'
    selection_cli:
        CommandLine|contains|all:
            - 'Set-Service'
            - '-StartupType'
        CommandLine|contains:
            - 'Disabled'
            - 'Manual'
    condition: all of selection_*
falsepositives:
    - False positives may occur with troubleshooting scripts
level: medium

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_img

selection_img:
    - Image|endswith: '\powershell.exe'
    - OriginalFileName: 'PowerShell.EXE'

Stage 2: selection_cli

selection_cli:
    CommandLine|contains|all:
        - 'Set-Service'
        - '-StartupType'
    CommandLine|contains:
        - 'Disabled'
        - 'Manual'

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLinematch
  • -StartupType
  • Disabled corpus 7 (sigma 5, elastic 1, splunk 1)
  • Manual corpus 2 (sigma 2)
  • Set-Service
field:"CommandLine" kind:match
Imageends_with
  • \powershell.exe corpus 179 (sigma 178, kusto 1)
field:"Image" kind:ends_with value:"\powershell.exe"
OriginalFileNameeq
  • PowerShell.EXE corpus 138 (sigma 84, splunk 30, elastic 24)
field:"OriginalFileName" kind:eq value:"PowerShell.EXE"