Windows PowerShell Script Block Logging: Nishang Commandlet Names and Arguments
High-severity alert on PowerShell script blocks that reference known Nishang commandlets and exfil/execution helper names.
- Product
- windows
- Category
- ps_script
- Author
- Alec Costello (SigmaHQ), DRL 1.1
- Published
- 2019-05-16
- 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 matches PowerShell script block content for known Nishang framework commandlet/function names. These artifacts can indicate attacker tradecraft for credential access, persistence, data collection, and execution workflows delivered via PowerShell. It relies on Script Block Logging telemetry to observe the exact text of commands and parameters within executed PowerShell script blocks.
Reporting behind it
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: "Windows PowerShell Script Block Logging: Nishang Commandlet Names and Arguments"
id: e182610d-c7dd-4c0a-ae30-877be922dd0f
status: test
description: This rule matches PowerShell script block content for known Nishang framework commandlet/function names. These artifacts can indicate attacker tradecraft for credential access, persistence, data collection, and execution workflows delivered via PowerShell. It relies on Script Block Logging telemetry to observe the exact text of commands and parameters within executed PowerShell script blocks.
references:
- https://github.com/samratashok/nishang
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_nishang_malicious_commandlets.yml
author: Alec Costello, Huntrule Team
date: 2019-05-16
modified: 2023-01-16
tags:
- attack.execution
- attack.t1059.001
logsource:
product: windows
category: ps_script
definition: "Requirements: Script Block Logging must be enabled"
detection:
selection:
ScriptBlockText|contains:
- Add-ConstrainedDelegationBackdoor
- Copy-VSS
- Create-MultipleSessions
- DataToEncode
- DNS_TXT_Pwnage
- Do-Exfiltration-Dns
- Download_Execute
- Download-Execute-PS
- DownloadAndExtractFromRemoteRegistry
- DumpCerts
- DumpCreds
- DumpHashes
- Enable-DuplicateToken
- Enable-Duplication
- Execute-Command-MSSQL
- Execute-DNSTXT-Code
- Execute-OnTime
- ExetoText
- exfill
- ExfilOption
- FakeDC
- FireBuster
- FireListener
- "Get-Information "
- Get-PassHints
- Get-Web-Credentials
- Get-WebCredentials
- Get-WLAN-Keys
- HTTP-Backdoor
- Invoke-AmsiBypass
- Invoke-BruteForce
- Invoke-CredentialsPhish
- Invoke-Decode
- Invoke-Encode
- Invoke-Interceptor
- Invoke-JSRatRegsvr
- Invoke-JSRatRundll
- Invoke-MimikatzWDigestDowngrade
- Invoke-NetworkRelay
- Invoke-PowerShellIcmp
- Invoke-PowerShellUdp
- Invoke-Prasadhak
- Invoke-PSGcat
- Invoke-PsGcatAgent
- Invoke-SessionGopher
- Invoke-SSIDExfil
- LoggedKeys
- Nishang
- NotAllNameSpaces
- Out-CHM
- OUT-DNSTXT
- Out-HTA
- Out-RundllCommand
- Out-SCF
- Out-SCT
- Out-Shortcut
- Out-WebQuery
- Out-Word
- Parse_Keys
- Password-List
- Powerpreter
- Remove-Persistence
- Remove-PoshRat
- Remove-Update
- Run-EXEonRemote
- Set-DCShadowPermissions
- Set-RemotePSRemoting
- Set-RemoteWMI
- Shellcode32
- Shellcode64
- StringtoBase64
- TexttoExe
condition: selection
falsepositives:
- Unknown
level: high
license: DRL-1.1
related:
- id: f772cee9-b7c2-4cb2-8f07-49870adc02e0
type: derived