Skip to content
Threat Feed
medium advisory

Detection of Alternate PowerShell Hosts

This brief describes the detection of non-standard applications executing PowerShell code, a technique used to evade security monitoring that relies solely on process-name-based filtering of powershell.exe.

Triage facts

Revision 1
Applicability
Windows
Evidence
Unknown
Severity
Medium
Action
Elevated
Freshness
Revision 1Oct 21, 00:48 UTC
Detection
1 rule
Source quality
A1Likely

Attackers frequently leverage alternative hosts to execute PowerShell scripts as a means to evade detection mechanisms configured to monitor only the standard powershell.exe or pwsh.exe processes. By embedding the PowerShell engine within custom binaries, signed trusted applications, or living-off-the-land binaries, adversaries can maintain persistence and perform post-exploitation activity while remaining invisible to standard process-creation telemetry focused on known interpreters. This technique involves utilizing the PowerShell managed API to host the runtime in-process, effectively decoupling the execution from the standard command-line wrappers. Defenders must monitor the PowerShell Module logging (Event ID 4103) to identify the "HostName" and "HostApplication" fields, which reveal the actual binary initiating the PowerShell runspace, rather than relying on process-based detection.

Attack Chain

  1. Attacker identifies a legitimate, signed, or obscure binary that supports hosting the .NET runtime.
  2. Attacker develops or selects a payload to execute in-memory via the hosted PowerShell engine.
  3. Attacker triggers the execution of the target binary with arguments that invoke the PowerShell runspace initialization.
  4. The host process initializes the System.Management.Automation assembly to host the PowerShell environment.
  5. The PowerShell engine executes the malicious script block or command, which appears as child activity of the host process, not powershell.exe.
  6. Attacker performs discovery, credential access, or data staging within the context of the host process.
  7. Attacker maintains stealth by avoiding spawns of child processes commonly monitored for PowerShell execution.

Impact

Successful abuse of alternate PowerShell hosts allows attackers to bypass endpoint detection and response (EDR) rules that alert on common PowerShell-related command-line arguments. This increases the attacker's dwell time and operational security, facilitating long-term access, lateral movement, and data exfiltration within target environments.

Recommendation

  • Enable Microsoft-Windows-PowerShell/Operational (Event ID 4103) to capture "HostName" and "HostApplication" metadata.
  • Deploy the provided Sigma rule to detect PowerShell code execution initiated by unexpected parent processes.
  • Baseline legitimate administrative tools in the environment to minimize false positives, specifically identifying software that uses the PowerShell API (e.g., system management or backup agents).

Immediate actions

Enable PowerShell Module Logging (Event ID 4103)

IT Operations 48h

Threat Hunt

Identify processes other than powershell.exe/pwsh.exe that trigger PowerShell Module events

T1059.001 medium high confidence hunt now

Data: Event ID 4103

Detection coverage 1

Detect Alternate PowerShell Hosts

medium

Detects PowerShell module activity initiated by processes other than standard PowerShell interpreters to identify potential bypasses.

sigma tactics: execution techniques: T1059.001 sources: ps_module, windows

Detection queries are available on the platform. Get full rules →