Sigma rule: Import New Module Via PowerShell CommandLine

A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-a737a20e9a38, updated 2023-12-01T00:00:00.000Z.

Rule

Title
Import New Module Via PowerShell CommandLine
Status
test
Level
low
Author
Nasreddine Bencherchali (Nextron Systems)
Date
2023-05-09
Modified
2023-12-01
File
rules-threat-hunting/windows/process_creation/proc_creation_win_powershell_import_module.yml
Commit
ccbb0369507f796db0b0ae6854c8a2be471b9d84

Detects usage of the "Import-Module" cmdlet in order to add new Cmdlets to the current PowerShell session

Log source

product
windows
category
process_creation

Detection

selection_img:
    - Image|endswith:
          - '\powershell.exe'
          - '\pwsh.exe'
    - OriginalFileName:
          - 'PowerShell.EXE'
          - 'pwsh.dll'
selection_cmdlet:
    CommandLine|contains:
        - 'Import-Module '
        - 'ipmo '
filter_main_vsstudio:
    ParentImage|contains:
        - ':\Program Files\WindowsApps\Microsoft.WindowsTerminal_'
        - ':\Windows\System32\cmd.exe'
    CommandLine|contains|all:
        - ':\Program Files\Microsoft Visual Studio\'
        - 'Tools\Microsoft.VisualStudio.DevShell.dll'
condition: all of selection_* and not 1 of filter_main_*

False positives (as the rule lists them)

  • Depending on the environement, many legitimate scripts will import modules inline. This rule is targeted for hunting purposes.

Tags

  • attack.execution
  • detection.threat-hunting

References

Read on 2026-11-03T00:58:21.399Z under licence sigma-drl-1.1@d5f4c36a from https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules-threat-hunting/windows/process_creation/proc_creation_win_powershell_import_module.yml

Sources and licences

  • SigmaHQ

    "Import New Module Via PowerShell CommandLine" by Nasreddine Bencherchali (Nextron Systems) (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules-threat-hunting/windows/process_creation/proc_creation_win_powershell_import_module.yml.
    Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License

    Detection Rule License (DRL) 1.1

Cite this page

Dragons Eye Ransomware Tracker, "Sigma rule: Import New Module Via PowerShell CommandLine",
entity page, dataset version ref-a737a20e9a38, updated 2023-12-01T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/4ad74d01-f48c-42d0-b88c-b31efa4d2262 (accessed 2026-11-03).
Underlying source: SigmaHQ rule 4ad74d01-f48c-42d0-b88c-b31efa4d2262, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.

Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.