Threat Huntlowtest

Import New Module Via PowerShell CommandLine

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

Convert In Phoenix Studio

Open this Sigma rule in the converter with the YAML preloaded and ready for backend selection.

Launch
Nasreddine Bencherchali (Nextron Systems)Created Tue May 09Updated Fri Dec 014ad74d01-f48c-42d0-b88c-b31efa4d2262windows
Hunting Hypothesis
Log Source
WindowsProcess Creation
ProductWindows← raw: windows
CategoryProcess Creation← raw: process_creation

Events generated when a new process is spawned on the system. Covers command-line arguments, parent/child relationships, and process metadata.

Detection Logic
Detection Logic3 selectors
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

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

MITRE ATT&CK

Other

detection.threat-hunting
Rule Metadata
Rule ID
4ad74d01-f48c-42d0-b88c-b31efa4d2262
Status
test
Level
low
Type
Threat Hunt
Created
Tue May 09
Modified
Fri Dec 01
Path
rules-threat-hunting/windows/process_creation/proc_creation_win_powershell_import_module.yml
Raw Tags
attack.executiondetection.threat-hunting
View on GitHub