Suspicious PowerShell Module Usage with Hidden/Encoded Execution Parameters on Windows
Flags hidden or encoded PowerShell invocations that decode/execute code or download-and-execute patterns, while filtering a Chocolatey installer snippet.
- Product
- windows
- Category
- ps_module
- Author
- Florian Roth (Nextron Systems), Jonhnathan Ribeiro (SigmaHQ), DRL 1.1
- Published
- 2017-03-05
- Updated
- 2026-07-31
ATT&CK techniques
ExecutionRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule flags PowerShell executions that include hidden or non-interactive invocation parameters combined with encoded or staged command execution patterns. It matters because attackers often use PowerShell to run payloads covertly via Base64 decoding, IEX-based execution, or encoded command options to reduce visibility. The detection relies on Windows telemetry containing PowerShell module ContextInfo strings with specific combinations of flags and command fragments (e.g., -nop, hidden windowing, -c with Convert.FromBase64String or iex/New-Object).
Reporting behind it
- Internal ResearchInternal Research
- github.comhttps://github.com/HackTricks-wiki/hacktricks/blob/e4c7b21b8f36c97c35b7c622732b38a189ce18f7/src/windows-hardening/windows-local-privilege-escalation/privilege-escalation-with-autorun-binaries.md
- github.comhttps://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_module/posh_pm_susp_invocation_specific.yml
Changelog
v2- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: Suspicious PowerShell Module Usage with Hidden/Encoded Execution Parameters on Windows
id: df447db8-de97-4cfb-8744-f164d7e3550f
related:
- id: fce5f582-cc00-41e1-941a-c6fabf0fdb8c
type: obsolete
- id: ae7fbf8e-f3cb-49fd-8db4-5f3bed522c71
type: similar
- id: 536e2947-3729-478c-9903-745aaffe60d2
type: similar
- id: 8ff28fdd-e2fa-4dfa-aeda-ef3d61c62090
type: derived
status: test
description: This rule flags PowerShell executions that include hidden or non-interactive invocation parameters combined with encoded or staged command execution patterns. It matters because attackers often use PowerShell to run payloads covertly via Base64 decoding, IEX-based execution, or encoded command options to reduce visibility. The detection relies on Windows telemetry containing PowerShell module ContextInfo strings with specific combinations of flags and command fragments (e.g., -nop, hidden windowing, -c with Convert.FromBase64String or iex/New-Object).
references:
- Internal Research
- https://github.com/HackTricks-wiki/hacktricks/blob/e4c7b21b8f36c97c35b7c622732b38a189ce18f7/src/windows-hardening/windows-local-privilege-escalation/privilege-escalation-with-autorun-binaries.md
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_module/posh_pm_susp_invocation_specific.yml
author: Florian Roth (Nextron Systems), Jonhnathan Ribeiro, Huntrule Team
date: 2017-03-05
modified: 2025-02-17
tags:
- attack.execution
- attack.t1059.001
logsource:
product: windows
category: ps_module
definition: 0ad03ef1-f21b-4a79-8ce8-e6900c54b65b
detection:
selection_convert_b64:
ContextInfo|contains|all:
- -nop
- " -w "
- hidden
- " -c "
- "[Convert]::FromBase64String"
selection_iex:
ContextInfo|contains|all:
- " -w "
- hidden
- -noni
- -nop
- " -c "
- iex
- New-Object
selection_enc:
ContextInfo|contains|all:
- " -w "
- hidden
- -ep
- bypass
- -Enc
selection_reg:
ContextInfo|contains|all:
- powershell
- reg
- add
ContextInfo|contains:
- \software\microsoft\windows\currentversion\run
- \software\wow6432node\microsoft\windows\currentversion\run
- \software\microsoft\windows\currentversion\policies\explorer\run
selection_webclient:
ContextInfo|contains|all:
- bypass
- -noprofile
- -windowstyle
- hidden
- new-object
- system.net.webclient
- .download
selection_iex_webclient:
ContextInfo|contains|all:
- iex
- New-Object
- Net.WebClient
- .Download
filter_chocolatey:
ContextInfo|contains:
- (New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1
- Write-ChocolateyWarning
condition: 1 of selection_* and not 1 of filter_*
falsepositives:
- Unknown
level: high
license: DRL-1.1