A Conduit for Subtle Threats in the Enterprise Landscape

Security Engineer, Qualys

00:00

/

00:00

In the ever-evolving cat-and-mouse game between attackers and defenders, it’s often the simplest tools that evade the deepest scrutiny. Our research highlights such simple yet powerful features within PowerShell that’s not widely used, and hence can be overlooked by standard AV/EDR settings. One of these features is PowerShell’s “Add-Type” cmdlet, which offers a native and compact mechanism to compile and execute .NET code at runtime, a feature that is often missed by defenders due to its simplicity and signed-by-design nature. While Add-Type PowerShell cmdlet is recognized to be frequently abused for dynamically compiling and loading C# code, even granular functionalities exist within the.NET ecosystem, like, System.Reflection.Emit.AssemblyBuilder.DefineDynamicAssembly and System.Reflection.Assembly::Load() provide low-level control over dynamic code generation and in-memory assembly loading, enabling evasive attack chains. Leveraging these primitives, attackers and threat actors can construct capable lightweight payloads. Our research analyzes the creation and utility of in-memory “gadgets” (which are modular C# constructs) using PowerShell to orchestrate remote process code injection, memory patching of telemetry interfaces (including ETW and AMSI) and in-memory execution of .NET assemblies. Our study references real-world APT tactics and red team implementations, demonstrating that these primitives can be readily adapted by adversaries to bypass defenses. Along with working examples, we will highlight how defenders can detect and mitigate such abuses while also discussing the current gaps in EDR engines when handling trusted runtime abuse.

A Movement to Counter Emerging Threats.

This is some text inside of a div block.
The SESSIONS
This is some text inside of a div block.
The SESSIONS
This is some text inside of a div block.

00:00

/

00:00

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Block quote

Ordered list

  1. Item 1
  2. Item 2
  3. Item 3

Unordered list

  • Item A
  • Item B
  • Item C

Text link

Bold text

Emphasis

Superscript

Subscript