Windows Security 4697: Obfuscated PowerShell via rundll32 shell32 shellexec_rundll

Alert on Security EID 4697 where service installation references rundll32/shell32.dll to launch PowerShell.

FreeReviewedSigma · Medium · v2
Product
windows
Service
security
Author
Timur Zinniatullin, oscd.community (SigmaHQ), DRL 1.1
Published
2020-10-18
Updated
2026-07-31
title: "Windows Security 4697: Obfuscated PowerShell via rundll32 shell32 shellexec_rundll"
id: 0f5a6917-77a4-46a8-991e-3101ab1e3664
related:
  - id: 11b52f18-aaec-4d60-9143-5dd8cc4706b9
    type: derived
  - id: f241cf1b-3a6b-4e1a-b4f9-133c00dd95ca
    type: derived
status: test
description: This rule flags Windows System Security Extension events where service execution references rundll32 (rundll32.exe) with shell32.dll and the shellexec_rundll entry, and the command line contains the string powershell. Attackers may use rundll32 to launch PowerShell in a way that blends into legitimate system behavior and can hinder straightforward command-line analysis. It relies on Windows Security audit EventID 4697 telemetry, matching the recorded service file name content and required substrings.
references:
  - https://github.com/SigmaHQ/sigma/issues/1009
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/security/win_security_invoke_obfuscation_via_rundll_services_security.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: security
  definition: The 'System Security Extension' audit subcategory need to be enabled to log the EID 4697
detection:
  selection:
    EventID: 4697
    ServiceFileName|contains|all:
      - rundll32.exe
      - shell32.dll
      - shellexec_rundll
      - powershell
  condition: selection
falsepositives:
  - Unknown
level: medium
license: DRL-1.1