Windows: Elevated PowerShell or CMD Spawned from Uncommon Parent Location

Alerts on elevated PowerShell/CMD executions whose parent process comes from uncommon Windows locations, indicating likely privilege escalation.

FreeUnreviewedSigmamediumv1
title: "Windows: Elevated PowerShell or CMD Spawned from Uncommon Parent Location"
id: cf82dc69-c0e3-4a3f-aefe-5e4b72012f5b
related:
  - id: 61065c72-5d7d-44ef-bf41-6a36684b545f
    type: similar
  - id: 178e615d-e666-498b-9630-9ed363038101
    type: derived
status: test
description: This rule flags process creation events where a Windows shell (PowerShell, PowerShell ISE, pwsh, or cmd) is launched with elevated privileges (User contains 'AUTHORI' variants and LogonId equals 0x3e7) and the parent process originates from an uncommon filesystem location. Attackers commonly use elevated shells to execute follow-on commands and tooling after privilege escalation. The detection relies on Windows process creation telemetry including Image/OriginalFileName for the spawned shell, User and LogonId to indicate elevated context, and ParentImage to identify uncommon parent paths while excluding known benign parent patterns.
references:
  - https://github.com/Wh04m1001/SysmonEoP
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_susp_elevated_system_shell_uncommon_parent.yml
author: frack113, Tim Shelton (update fp), Huntrule Team
date: 2022-12-05
modified: 2025-03-06
tags:
  - attack.privilege-escalation
  - attack.execution
  - attack.t1059
logsource:
  product: windows
  category: process_creation
detection:
  selection_shell:
    - Image|endswith:
        - \powershell.exe
        - \powershell_ise.exe
        - \pwsh.exe
        - \cmd.exe
    - OriginalFileName:
        - PowerShell.EXE
        - powershell_ise.EXE
        - pwsh.dll
        - Cmd.Exe
  selection_user:
    User|contains:
      - AUTHORI
      - AUTORI
    LogonId: "0x3e7"
  filter_main_generic:
    ParentImage|contains:
      - :\Program Files (x86)\
      - :\Program Files\
      - :\ProgramData\
      - :\Windows\System32\
      - :\Windows\SysWOW64\
      - :\Windows\Temp\
      - :\Windows\WinSxS\
  filter_optional_manageengine:
    ParentImage|endswith: :\ManageEngine\ADManager Plus\pgsql\bin\postgres.exe
    Image|endswith: \cmd.exe
  filter_optional_asgard:
    CommandLine|contains: :\WINDOWS\system32\cmd.exe /c "
    CurrentDirectory|contains: :\WINDOWS\Temp\asgard2-agent\
  filter_optional_ibm_spectrumprotect:
    ParentImage|contains: :\IBM\SpectrumProtect\webserver\scripts\
    CommandLine|contains: :\IBM\SpectrumProtect\webserver\scripts\
  filter_main_parent_null:
    ParentImage: null
  filter_main_parent_empty:
    ParentImage:
      - ""
      - "-"
  condition: all of selection_* and not 1 of filter_main_* and not 1 of filter_optional_*
falsepositives:
  - Some legitimate applications may spawn shells from uncommon parent locations. Apply additional filters and perform an initial baseline before deploying.
level: medium
license: DRL-1.1

What it detects

This rule flags process creation events where a Windows shell (PowerShell, PowerShell ISE, pwsh, or cmd) is launched with elevated privileges (User contains 'AUTHORI' variants and LogonId equals 0x3e7) and the parent process originates from an uncommon filesystem location. Attackers commonly use elevated shells to execute follow-on commands and tooling after privilege escalation. The detection relies on Windows process creation telemetry including Image/OriginalFileName for the spawned shell, User and LogonId to indicate elevated context, and ParentImage to identify uncommon parent paths while excluding known benign parent patterns.

Known false positives

  • Some legitimate applications may spawn shells from uncommon parent locations. Apply additional filters and perform an initial baseline before deploying.

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.