PowerShell Assembly Loading via CL_LoadAssembly.ps1 Functions

Alerts on PowerShell command lines that call LoadAssemblyFromPath/LoadAssemblyFromNS in CL_LoadAssembly.ps1 context.

FreeUnreviewedSigmamediumv1
title: PowerShell Assembly Loading via CL_LoadAssembly.ps1 Functions
id: 566da814-63a6-4467-adb5-7f528de6e218
status: test
description: This rule flags PowerShell process command lines that include calls to LoadAssemblyFromPath or LoadAssemblyFromNS associated with the CL_LoadAssembly.ps1 script. Attackers can use assembly loading to execute or access code from external libraries, potentially bypassing allowlisting controls such as AppLocker. It relies on process creation telemetry and matches command-line substrings indicating inline use of these functions.
references:
  - https://bohops.com/2018/01/07/executing-commands-and-bypassing-applocker-with-powershell-diagnostic-scripts/
  - https://lolbas-project.github.io/lolbas/Scripts/CL_LoadAssembly/
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_powershell_cl_loadassembly.yml
author: frack113, Nasreddine Bencherchali (Nextron Systems), Huntrule Team
date: 2022-05-21
modified: 2023-08-17
tags:
  - attack.stealth
  - attack.t1216
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    CommandLine|contains:
      - "LoadAssemblyFromPath "
      - "LoadAssemblyFromNS "
  condition: selection
falsepositives:
  - Unknown
level: medium
license: DRL-1.1
related:
  - id: c57872c7-614f-4d7f-a40d-b78c8df2d30d
    type: derived

What it detects

This rule flags PowerShell process command lines that include calls to LoadAssemblyFromPath or LoadAssemblyFromNS associated with the CL_LoadAssembly.ps1 script. Attackers can use assembly loading to execute or access code from external libraries, potentially bypassing allowlisting controls such as AppLocker. It relies on process creation telemetry and matches command-line substrings indicating inline use of these functions.

Known false positives

  • Unknown

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.