Skip to content

Add new powershell rule#6061

Open
norbert791 wants to merge 2 commits into
SigmaHQ:masterfrom
norbert791:new-windows-rule
Open

Add new powershell rule#6061
norbert791 wants to merge 2 commits into
SigmaHQ:masterfrom
norbert791:new-windows-rule

Conversation

@norbert791

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Adds a new Windows PowerShell ScriptBlock rule to detect scripts that enumerate
Microsoft.PowerShell.Utility exported commands and invoke cmdlets indirectly by
array index. This behavior can be used to avoid explicit references to cmdlets
such as Invoke-RestMethod or Invoke-Expression.

Changelog

new: Potential Cmdlet Invocation Via ExportedCommands Array Index

Example Log Event

Fixed Issues

SigmaHQ Rule Creation Conventions

  • If your PR adds new rules, please consider following and applying these conventions

@github-actions github-actions Bot added Rules Review Needed The PR requires review Windows Pull request add/update windows related rules labels Jun 11, 2026
@nasbench nasbench added this to the Sigma-June-Release milestone Jun 11, 2026
Co-authored-by: Nasreddine Bencherchali <nbencher@cisco.com>
@swachchhanda000

Copy link
Copy Markdown
Collaborator

Don't merge yet. I would like to try it out myself.

- 'ExportedCommands'
- 'Values'
selection_index_used:
ScriptBlockText|contains: '[*]'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will search in all the ScriptBlockText [ any caracter ] that can be prone to FP , but with the selection_module_export_enum it should be fine, isn't it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review Needed The PR requires review Rules Windows Pull request add/update windows related rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants