Detection rules › Sigma

Stop Windows Service Via PowerShell Stop-Service

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

Detects the stopping of a Windows service via the PowerShell Cmdlet "Stop-Service"

Known false positives

  • There are many legitimate reasons to stop a service. This rule isn't looking for any suspicious behaviour in particular. Filter legitimate activity accordingly

MITRE ATT&CK coverage

TacticTechniques
Impact

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

title: Stop Windows Service Via PowerShell Stop-Service
id: c49c5062-0966-4170-9efd-9968c913a6cf
related:
    - id: eb87818d-db5d-49cc-a987-d5da331fbd90
      type: obsolete
status: test
description: Detects the stopping of a Windows service via the PowerShell Cmdlet "Stop-Service"
references:
    - https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/stop-service?view=powershell-7.4
author: Jakob Weinzettl, oscd.community, Nasreddine Bencherchali (Nextron Systems)
date: 2023-03-05
tags:
    - attack.impact
    - attack.t1489
logsource:
    category: process_creation
    product: windows
detection:
    selection_sc_net_img:
        - OriginalFileName:
              - 'PowerShell.EXE'
              - 'pwsh.dll'
        - Image|endswith:
              - '\powershell.exe'
              - '\pwsh.exe'
    selection_cli:
        CommandLine|contains: 'Stop-Service '
    condition: all of selection_*
falsepositives:
    - There are many legitimate reasons to stop a service. This rule isn't looking for any suspicious behaviour in particular. Filter legitimate activity accordingly
level: low

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_sc_net_img

selection_sc_net_img:
    - OriginalFileName:
          - 'PowerShell.EXE'
          - 'pwsh.dll'
    - Image|endswith:
          - '\powershell.exe'
          - '\pwsh.exe'

Stage 2: selection_cli

selection_cli:
    CommandLine|contains: 'Stop-Service '

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLinematch
  • Stop-Service corpus 4 (sigma 2, splunk 2)
field:"CommandLine" kind:match value:"Stop-Service "
Imageends_with
  • \powershell.exe corpus 179 (sigma 178, kusto 1)
  • \pwsh.exe corpus 165 (sigma 164, kusto 1)
field:"Image" kind:ends_with
OriginalFileNameeq
  • PowerShell.EXE corpus 138 (sigma 84, splunk 30, elastic 24)
  • pwsh.dll corpus 112 (sigma 79, splunk 30, elastic 3)
field:"OriginalFileName" kind:eq