← Back to SOC feed Coverage →

Potential Suspicious PowerShell Module File Created

sigma MEDIUM SigmaHQ
imFileEvent
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at SigmaHQ →
Retrieved: 2026-03-25T03:05:59Z · Confidence: medium

Hunt Hypothesis

Adversaries may be creating a PowerShell module to execute malicious code or establish persistence. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential initial compromise vectors and mitigate advanced threats.

Detection Rule

Sigma (Original)

title: Potential Suspicious PowerShell Module File Created
id: e8a52bbd-bced-459f-bd93-64db45ce7657
status: test
description: Detects the creation of a new PowerShell module in the first folder of the module directory structure "\WindowsPowerShell\Modules\malware\malware.psm1". This is somewhat an uncommon practice as legitimate modules often includes a version folder.
references:
    - Internal Research
    - https://learn.microsoft.com/en-us/powershell/scripting/developer/module/understanding-a-windows-powershell-module?view=powershell-7.3
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-05-09
tags:
    - attack.persistence
logsource:
    category: file_event
    product: windows
detection:
    selection:
        TargetFilename|endswith:
            # Note: Don't include PowerShell 7 as it has default modules that don't follow this logic
            - '\\WindowsPowerShell\\Modules\\*\.ps'
            - '\\WindowsPowerShell\\Modules\\*\.dll'
    condition: selection
falsepositives:
    - False positive rate will vary depending on the environments. Additional filters might be required to make this logic usable in production.
level: medium

KQL (Azure Sentinel)

imFileEvent
| where (TargetFileName contains "\\WindowsPowerShell\\Modules\\" and TargetFileName contains "\\.ps") or (TargetFileName contains "\\WindowsPowerShell\\Modules\\" and TargetFileName contains "\\.dll")

False Positive Guidance

MITRE ATT&CK Context

Original source: https://github.com/SigmaHQ/sigma/blob/master/rules/windows/file/file_event/file_event_win_powershell_module_susp_creation.yml