Potential In-Memory Execution Using Reflection.Assembly
Detects usage of "Reflection.Assembly" load functions to dynamically load assemblies in memory
Sigma rule (View on GitHub)
1title: Potential In-Memory Execution Using Reflection.Assembly
2id: ddcd88cb-7f62-4ce5-86f9-1704190feb0a
3status: test
4description: Detects usage of "Reflection.Assembly" load functions to dynamically load assemblies in memory
5references:
6 - https://speakerdeck.com/heirhabarov/hunting-for-powershell-abuse?slide=50
7author: frack113
8date: 2022-12-25
9modified: 2026-10-19
10tags:
11 - attack.stealth
12 - attack.t1620
13logsource:
14 product: windows
15 category: ps_script
16 definition: Script Block Logging must be enable
17detection:
18 selection:
19 ScriptBlockText|contains: '[Reflection.Assembly]::load'
20 filter_optional_sqlserver:
21 Path|startswith:
22 - 'C:\Program Files (x86)\Microsoft SQL Server\'
23 - 'C:\Program Files\Microsoft SQL Server\'
24 Path|endswith: '\Tools\PowerShell\Modules\SQLPS\SqlPsPostScript.ps1'
25 ScriptBlockText|contains: 'SQLSERVER: { Set-Location'
26 condition: selection and not 1 of filter_optional_*
27falsepositives:
28 - Legitimate use of the library
29level: medium
30regression_tests_path: regression_data/rules/windows/powershell/powershell_script/posh_ps_dotnet_assembly_from_file/info.yml
References
Related rules
- Potential WinAPI Calls Via PowerShell Scripts
- PowerShell Base64 Encoded Reflective Assembly Load
- DllUnregisterServer Function Call Via Msiexec.EXE
- PSScriptPolicyTest Creation By Uncommon Process
- Uncommon Svchost Parent Process