Potential In-Memory Execution Using Reflection.Assembly

 Original Source: [Sigma source]
Title: Potential In-Memory Execution Using Reflection.Assembly
Status: test
Description:Detects usage of "Reflection.Assembly" load functions to dynamically load assemblies in memory
References:
  -https://speakerdeck.com/heirhabarov/hunting-for-powershell-abuse?slide=50
Author: frack113
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