Windows PowerShell In-Memory Assembly Loading via Reflection.Assembly::Load

Flags PowerShell script blocks that reference [Reflection.Assembly]::load for potential in-memory assembly loading.

FreeReviewedSigma · Medium · v5
Product
windows
Category
ps_script
Author
frack113 (SigmaHQ), DRL 1.1
Published
2022-12-25
Updated
2026-10-21
title: Windows PowerShell In-Memory Assembly Loading via Reflection.Assembly::Load
id: 33e74b87-0561-436e-afcc-b5486436f69e
status: test
description: This rule flags PowerShell script block content that contains the pattern "[Reflection.Assembly]::load", indicating an attempt to dynamically load an assembly from memory using .NET reflection. Attackers can use this technique to execute code in a stealthier way than dropping binaries to disk. The detection relies on Script Block Logging telemetry that records the PowerShell script block text.
references:
  - https://speakerdeck.com/heirhabarov/hunting-for-powershell-abuse?slide=50
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_dotnet_assembly_from_file.yml
author: frack113, Huntrule Team
date: 2022-12-25
modified: 2026-10-19
tags:
  - attack.stealth
  - attack.t1620
logsource:
  product: windows
  category: ps_script
  definition: Script Block Logging must be enable
detection:
  selection:
    ScriptBlockText|contains: "[Reflection.Assembly]::load"
  filter_optional_sqlserver:
    Path|startswith:
      - C:\Program Files (x86)\Microsoft SQL Server\
      - C:\Program Files\Microsoft SQL Server\
    Path|endswith: \Tools\PowerShell\Modules\SQLPS\SqlPsPostScript.ps1
    ScriptBlockText|contains: "SQLSERVER: { Set-Location"
  condition: selection and not 1 of filter_optional_*
falsepositives:
  - Legitimate use of the library
level: medium
regression_tests_path: regression_data/rules/windows/powershell/powershell_script/posh_ps_dotnet_assembly_from_file/info.yml
license: DRL-1.1
related:
  - id: ddcd88cb-7f62-4ce5-86f9-1704190feb0a
    type: derived