Function Pointer Cache Hijacking AMSI ETW Bypass
Score: 8/10

Function Pointer Cache Hijacking AMSI ETW Bypass

A novel technique called Function Pointer Cache Hijacking manipulates the .NET internal MethodDesc structure to redirect AMSI and ETW function calls to harmless native APIs like GetCurrentThreadId.

Executive Summary

A new defense evasion technique dubbed "Function Pointer Cache Hijacking" has been identified, targeting the Antimalware Scan Interface (AMSI) and Event Tracing for Windows (ETW) within PowerShell sessions. Developed by researcher Amr Thabet, the method exploits how the .NET Common Language Runtime (CLR) caches native function pointers in writable heap memory. By overwriting these cached pointers using .NET reflection, an attacker can redirect critical security functions to harmless APIs without triggering standard detection mechanisms.

Technically, the attack avoids traditional red flags such as memory patching of DLL code sections or calling `VirtualProtect`, which are frequently monitored by EDR solutions. Instead, it uses pure managed PowerShell code to modify the `MethodDesc` structure in the heap. This allows the attacker to effectively blind AMSI and silence Script Block Logging (EID 4104) and Command Lifecycle logging (EID 7937) while maintaining compatibility with Windows Control Flow Guard (CFG).

This technique represents a significant shift in bypass tradecraft because it operates entirely within the data plane of the .NET runtime. It poses a high risk to organizations relying on PowerShell telemetry for threat hunting, as it can be implemented in as few as 14 lines of code without dropping files to disk or modifying executable memory sections.

Key Details

Threat Name

Function Pointer Cache Hijacking

Affects

—

Adversary

—

MITRE Techniques

Malware/Tools

None identified

Report Score

8out of 10
Quality Score
Good
IOC Quality0
TTP Details9
Detection Guidance7
Enterprise Relevance9
Clarity & Structure10
Technical Depth10

Sources