Windows System: Service Control Manager PowerShell Obfuscation Using COMPRESS OBFUSCATION

Flags new Windows services whose ImagePath includes obfuscated PowerShell markers using COMPRESS/stream decompression.

FreeReviewedSigma · Medium · v2
Product
windows
Service
system
Author
Timur Zinniatullin, oscd.community (SigmaHQ), DRL 1.1
Published
2020-10-18
Updated
2026-07-31
title: "Windows System: Service Control Manager PowerShell Obfuscation Using COMPRESS OBFUSCATION"
id: 804e82d2-4506-4458-a3aa-bc6d43391d6f
status: test
description: This rule identifies a Windows service creation attempt where the Service Control Manager launches PowerShell-like scripting indicators that include obfuscation and compression components. Attackers may use obfuscated command content to evade string-based detections and to package or decode payloads at execution time. The detection relies on System service control events (Event ID 7045) and inspects the registered ImagePath for specific PowerShell and .NET compression/stream reader substrings.
references:
  - https://github.com/SigmaHQ/sigma/issues/1009
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/system/service_control_manager/win_system_invoke_obfuscation_via_compress_services.yml
author: Timur Zinniatullin, oscd.community, Huntrule Team
date: 2020-10-18
modified: 2022-11-29
tags:
  - attack.stealth
  - attack.t1027
  - attack.execution
  - attack.t1059.001
logsource:
  product: windows
  service: system
detection:
  selection:
    Provider_Name: Service Control Manager
    EventID: 7045
    ImagePath|contains|all:
      - new-object
      - text.encoding]::ascii
      - readtoend
    ImagePath|contains:
      - :system.io.compression.deflatestream
      - system.io.streamreader
  condition: selection
falsepositives:
  - Unknown
level: medium
license: DRL-1.1
related:
  - id: 175997c5-803c-4b08-8bb0-70b099f47595
    type: derived