Detection rules › Sigma

PowerShell Core DLL Loaded By Non PowerShell Process

Status
test
Severity
medium
Log source
category image_load, product windows
Author
Tom Kern, oscd.community, Natalia Shornikova, Tim Shelton, Roberto Rodriguez (Cyb3rWard0g), OTR (Open Threat Research)
Source
github.com/SigmaHQ/sigma

Detects loading of essential DLLs used by PowerShell by non-PowerShell process. Detects behavior similar to meterpreter's "load powershell" extension.

Known false positives

  • Used by some .NET binaries, minimal on user workstation.
  • Used by Microsoft SQL Server Management Studio

MITRE ATT&CK coverage

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 7: Image loaded

Rule body

title: PowerShell Core DLL Loaded By Non PowerShell Process
id: 092bc4b9-3d1d-43b4-a6b4-8c8acd83522f
related:
    - id: 867613fb-fa60-4497-a017-a82df74a172c
      type: obsolete
    - id: fe6e002f-f244-4278-9263-20e4b593827f
      type: obsolete
status: test
description: |
    Detects loading of essential DLLs used by PowerShell by non-PowerShell process.
    Detects behavior similar to meterpreter's "load powershell" extension.
references:
    - https://adsecurity.org/?p=2921
    - https://github.com/p3nt4/PowerShdll
author: Tom Kern, oscd.community, Natalia Shornikova, Tim Shelton, Roberto Rodriguez (Cyb3rWard0g), OTR (Open Threat Research)
date: 2019-11-14
modified: 2026-07-28
tags:
    - attack.t1059.001
    - attack.execution
logsource:
    category: image_load
    product: windows
detection:
    selection:
        - Description: 'System.Management.Automation'
        - OriginalFileName: 'System.Management.Automation.dll'
        - ImageLoaded|endswith:
              - '\System.Management.Automation.dll'
              - '\System.Management.Automation.ni.dll'
    filter_main_powershell:
        Image:
            - 'C:\Program Files\PowerShell\7-preview\pwsh.exe' # PowerShell 7 preview
            - 'C:\Program Files\PowerShell\7\pwsh.exe' # PowerShell 7
            - 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe'
            - 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'
            - 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell_ise.exe'
            - 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe'
    filter_main_pwsh_preview:
        Image|contains:
            - 'C:\Program Files\WindowsApps\Microsoft.PowerShellPreview'
            - '\AppData\Local\Microsoft\WindowsApps\Microsoft.PowerShellPreview'
        Image|endswith: '\pwsh.exe'
    filter_main_generic:
        Image:
            - 'C:\Windows\System32\dsac.exe'
            - 'C:\WINDOWS\System32\RemoteFXvGPUDisablement.exe'
            - 'C:\Windows\System32\runscripthelper.exe'
            - 'C:\WINDOWS\System32\sdiagnhost.exe'
            - 'C:\Windows\System32\ServerManager.exe'
            - 'C:\Windows\System32\SyncAppvPublishingServer.exe'
            - 'C:\Windows\System32\winrshost.exe'
            - 'C:\Windows\System32\wsmprovhost.exe'
            - 'C:\Windows\SysWOW64\winrshost.exe'
            - 'C:\Windows\SysWOW64\wsmprovhost.exe'
    filter_main_dotnet:
        Image|startswith:
            - 'C:\Windows\Microsoft.NET\Framework\'
            - 'C:\Windows\Microsoft.NET\FrameworkArm\'
            - 'C:\Windows\Microsoft.NET\FrameworkArm64\'
            - 'C:\Windows\Microsoft.NET\Framework64\'
        Image|endswith: '\mscorsvw.exe'
    filter_optional_gethelp:
        Image|startswith: 'C:\Program Files\WindowsApps\Microsoft.GetHelp_'
        Image|endswith: '\GetHelp.exe'
    filter_optional_sql_server_mgmt:
        Image|startswith:
            - 'C:\Program Files (x86)\Microsoft SQL Server Management Studio'
            - 'C:\Program Files\Microsoft SQL Server Management Studio'
        Image|endswith: '\IDE\Ssms.exe'
    filter_optional_sql_server_tools:
        Image|startswith:
            - 'C:\Program Files (x86)\Microsoft SQL Server\'
            - 'C:\Program Files\Microsoft SQL Server\'
        Image|endswith: '\Tools\Binn\SQLPS.exe'
    filter_optional_citrix:
        Image|endswith: '\Citrix\ConfigSync\ConfigSyncRun.exe'
    filter_optional_vs:
        Image|startswith:
            - 'C:\Program Files (x86)\Microsoft Visual Studio\'
            - 'C:\Program Files\Microsoft Visual Studio\'
    filter_optional_chocolatey:
        Image|startswith: 'C:\ProgramData\chocolatey\choco.exe'
    filter_optional_nextron:
        Image|startswith: 'C:\Windows\Temp\asgard2-agent\'
        Image|endswith:
            - '\thor64.exe'
            - '\thor.exe'
        # User: 'NT AUTHORITY\SYSTEM'   # if set, matches all powershell processes not launched by SYSTEM
    filter_optional_aurora:
        # This filter is to avoid a race condition FP with this specific ETW provider in aurora
        Image: null
    condition: selection and not 1 of filter_main_* and not 1 of filter_optional_*
falsepositives:
    - Used by some .NET binaries, minimal on user workstation.
    - Used by Microsoft SQL Server Management Studio
level: medium

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_main_* and not 1 of filter_optional_*

Stage 1: selection

selection:
    - Description: 'System.Management.Automation'
    - OriginalFileName: 'System.Management.Automation.dll'
    - ImageLoaded|endswith:
          - '\System.Management.Automation.dll'
          - '\System.Management.Automation.ni.dll'

Stage 2: not filter_main_*

filter_main_powershell:
    Image:
        - 'C:\Program Files\PowerShell\7-preview\pwsh.exe'
        - 'C:\Program Files\PowerShell\7\pwsh.exe'
        - 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe'
        - 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'
        - 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell_ise.exe'
        - 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe'
filter_main_pwsh_preview:
    Image|contains:
        - 'C:\Program Files\WindowsApps\Microsoft.PowerShellPreview'
        - '\AppData\Local\Microsoft\WindowsApps\Microsoft.PowerShellPreview'
    Image|endswith: '\pwsh.exe'
filter_main_generic:
    Image:
        - 'C:\Windows\System32\dsac.exe'
        - 'C:\WINDOWS\System32\RemoteFXvGPUDisablement.exe'
        - 'C:\Windows\System32\runscripthelper.exe'
        - 'C:\WINDOWS\System32\sdiagnhost.exe'
        - 'C:\Windows\System32\ServerManager.exe'
        - 'C:\Windows\System32\SyncAppvPublishingServer.exe'
        - 'C:\Windows\System32\winrshost.exe'
        - 'C:\Windows\System32\wsmprovhost.exe'
        - 'C:\Windows\SysWOW64\winrshost.exe'
        - 'C:\Windows\SysWOW64\wsmprovhost.exe'
filter_main_dotnet:
    Image|startswith:
        - 'C:\Windows\Microsoft.NET\Framework\'
        - 'C:\Windows\Microsoft.NET\FrameworkArm\'
        - 'C:\Windows\Microsoft.NET\FrameworkArm64\'
        - 'C:\Windows\Microsoft.NET\Framework64\'
    Image|endswith: '\mscorsvw.exe'

Stage 3: not filter_optional_*

filter_optional_gethelp:
    Image|startswith: 'C:\Program Files\WindowsApps\Microsoft.GetHelp_'
    Image|endswith: '\GetHelp.exe'
filter_optional_sql_server_mgmt:
    Image|startswith:
        - 'C:\Program Files (x86)\Microsoft SQL Server Management Studio'
        - 'C:\Program Files\Microsoft SQL Server Management Studio'
    Image|endswith: '\IDE\Ssms.exe'
filter_optional_sql_server_tools:
    Image|startswith:
        - 'C:\Program Files (x86)\Microsoft SQL Server\'
        - 'C:\Program Files\Microsoft SQL Server\'
    Image|endswith: '\Tools\Binn\SQLPS.exe'
filter_optional_citrix:
    Image|endswith: '\Citrix\ConfigSync\ConfigSyncRun.exe'
filter_optional_vs:
    Image|startswith:
        - 'C:\Program Files (x86)\Microsoft Visual Studio\'
        - 'C:\Program Files\Microsoft Visual Studio\'
filter_optional_chocolatey:
    Image|startswith: 'C:\ProgramData\chocolatey\choco.exe'
filter_optional_nextron:
    Image|startswith: 'C:\Windows\Temp\asgard2-agent\'
    Image|endswith:
        - '\thor64.exe'
        - '\thor.exe'
filter_optional_aurora:
    Image: null

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
ImagematchC:\Program Files\WindowsApps\Microsoft.PowerShellPreviewexcludes:Image field:"Image" value:"C:\Program Files\WindowsApps\Microsoft.PowerShellPreview"
Imagematch\AppData\Local\Microsoft\WindowsApps\Microsoft.PowerShellPreviewexcludes:Image field:"Image" value:"\AppData\Local\Microsoft\WindowsApps\Microsoft.PowerShellPreview"
Imageends_with\pwsh.exeexcludes:Image field:"Image" value:"\pwsh.exe"
Imagestarts_withC:\Windows\Microsoft.NET\Framework64\excludes:Image field:"Image" value:"C:\Windows\Microsoft.NET\Framework64\"
Imagestarts_withC:\Windows\Microsoft.NET\FrameworkArm64\excludes:Image field:"Image" value:"C:\Windows\Microsoft.NET\FrameworkArm64\"
Imagestarts_withC:\Windows\Microsoft.NET\FrameworkArm\excludes:Image field:"Image" value:"C:\Windows\Microsoft.NET\FrameworkArm\"
Imagestarts_withC:\Windows\Microsoft.NET\Framework\excludes:Image field:"Image" value:"C:\Windows\Microsoft.NET\Framework\"
Imageends_with\mscorsvw.exeexcludes:Image field:"Image" value:"\mscorsvw.exe"
ImageeqC:\Program Files\PowerShell\7-preview\pwsh.exeexcludes:Image field:"Image" value:"C:\Program Files\PowerShell\7-preview\pwsh.exe"
ImageeqC:\Program Files\PowerShell\7\pwsh.exeexcludes:Image field:"Image" value:"C:\Program Files\PowerShell\7\pwsh.exe"
ImageeqC:\WINDOWS\System32\RemoteFXvGPUDisablement.exeexcludes:Image field:"Image" value:"C:\WINDOWS\System32\RemoteFXvGPUDisablement.exe"
ImageeqC:\WINDOWS\System32\sdiagnhost.exeexcludes:Image field:"Image" value:"C:\WINDOWS\System32\sdiagnhost.exe"
ImageeqC:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exeexcludes:Image field:"Image" value:"C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe"
ImageeqC:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell_ise.exeexcludes:Image field:"Image" value:"C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell_ise.exe"
ImageeqC:\Windows\SysWOW64\winrshost.exeexcludes:Image field:"Image" value:"C:\Windows\SysWOW64\winrshost.exe"
ImageeqC:\Windows\SysWOW64\wsmprovhost.exeexcludes:Image field:"Image" value:"C:\Windows\SysWOW64\wsmprovhost.exe"
ImageeqC:\Windows\System32\ServerManager.exeexcludes:Image field:"Image" value:"C:\Windows\System32\ServerManager.exe"
ImageeqC:\Windows\System32\SyncAppvPublishingServer.exeexcludes:Image field:"Image" value:"C:\Windows\System32\SyncAppvPublishingServer.exe"
ImageeqC:\Windows\System32\WindowsPowerShell\v1.0\powershell.exeexcludes:Image field:"Image" value:"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
ImageeqC:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exeexcludes:Image field:"Image" value:"C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe"
ImageeqC:\Windows\System32\dsac.exeexcludes:Image field:"Image" value:"C:\Windows\System32\dsac.exe"
ImageeqC:\Windows\System32\runscripthelper.exeexcludes:Image field:"Image" value:"C:\Windows\System32\runscripthelper.exe"
ImageeqC:\Windows\System32\winrshost.exeexcludes:Image field:"Image" value:"C:\Windows\System32\winrshost.exe"
ImageeqC:\Windows\System32\wsmprovhost.exeexcludes:Image field:"Image" value:"C:\Windows\System32\wsmprovhost.exe"
Imageends_with\thor.exeexcludes:Image field:"Image" value:"\thor.exe"
Imageends_with\thor64.exeexcludes:Image field:"Image" value:"\thor64.exe"
Imagestarts_withC:\Windows\Temp\asgard2-agent\excludes:Image field:"Image" value:"C:\Windows\Temp\asgard2-agent\"
Imagestarts_withC:\Program Files (x86)\Microsoft SQL Server Management Studioexcludes:Image field:"Image" value:"C:\Program Files (x86)\Microsoft SQL Server Management Studio"
Imagestarts_withC:\Program Files\Microsoft SQL Server Management Studioexcludes:Image field:"Image" value:"C:\Program Files\Microsoft SQL Server Management Studio"
Imageends_with\IDE\Ssms.exeexcludes:Image field:"Image" value:"\IDE\Ssms.exe"
Imagestarts_withC:\Program Files (x86)\Microsoft SQL Server\excludes:Image field:"Image" value:"C:\Program Files (x86)\Microsoft SQL Server\"
Imagestarts_withC:\Program Files\Microsoft SQL Server\excludes:Image field:"Image" value:"C:\Program Files\Microsoft SQL Server\"
Imageends_with\Tools\Binn\SQLPS.exeexcludes:Image field:"Image" value:"\Tools\Binn\SQLPS.exe"
Imageends_with\GetHelp.exeexcludes:Image field:"Image" value:"\GetHelp.exe"
Imagestarts_withC:\Program Files\WindowsApps\Microsoft.GetHelp_excludes:Image field:"Image" value:"C:\Program Files\WindowsApps\Microsoft.GetHelp_"
Imageends_with\Citrix\ConfigSync\ConfigSyncRun.exeexcludes:Image field:"Image" value:"\Citrix\ConfigSync\ConfigSyncRun.exe"
Imageis_null(no value, null check)excludes:Image
Imagestarts_withC:\Program Files (x86)\Microsoft Visual Studio\excludes:Image field:"Image" value:"C:\Program Files (x86)\Microsoft Visual Studio\"
Imagestarts_withC:\Program Files\Microsoft Visual Studio\excludes:Image field:"Image" value:"C:\Program Files\Microsoft Visual Studio\"
Imagestarts_withC:\ProgramData\chocolatey\choco.exeexcludes:Image field:"Image" value:"C:\ProgramData\chocolatey\choco.exe"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Descriptioneq
  • System.Management.Automation
field:"Description" kind:eq value:"System.Management.Automation"
ImageLoadedends_with
  • \System.Management.Automation.dll
  • \System.Management.Automation.ni.dll
field:"ImageLoaded" kind:ends_with
OriginalFileNameeq
  • System.Management.Automation.dll
field:"OriginalFileName" kind:eq value:"System.Management.Automation.dll"