Cyber security

AMSI Bypass via VEH – Technique Using Vectored Exception Handling

A PowerShell AMSI Bypass technique via Vectored Exception Handler (VEH). This technique does not perform assembly instruction patching, function hooking or Import Address Table (IAT) modification.


How It Works:

For this technique to work, you must first inject the VEH DLL into the PowerShell process. This can be done either by injecting the DLL or via DLL hijacking .

This technique works by setting up a hardware breakpoint on the function AmsiScanBuffer on all PowerShell process threads, then installing a VEH to handle the trigger of this breakpoint.

When a thread calls AmsiScanBuffer, the VEH will make the thread to exit the function without executing anything and setting the result of the function to AMSI_RESULT_CLEAN.

This is all done inside the VEH, without modifying the code of the process or without any PE modifications.


Usage:

For demonstration purposes, this repository contains a very basic DLL injector. Use it this way:

  • 1.) Compile the DLL Injector and VEH DLL.
  • 2.) Open an instance of PowerShell.
  • 3.) Run the DLL injector by providing the FULL PATH to the DLL. Example:
./DLL_Injector.exe C:\Windows\Temp\AMSI_VEH.DLL
Tamil S

Tamil has a great interest in the fields of Cyber Security, OSINT, and CTF projects. Currently, he is deeply involved in researching and publishing various security tools with Kali Linux Tutorials, which is quite fascinating.

Recent Posts

MSI Analyzer – Analyzing Windows Installer Files For Vulnerabilities

This Python script for Linux can analyze Microsoft Windows *.msi Installer files and point out…

17 hours ago

BEAR-C2 : Simulated Command And Control Framework For APT Attack Research

Bear C2 is a compilation of C2 scripts, payloads, and stagers used in simulated attacks…

17 hours ago

Bearer – A Quick Guide To Scanning And Securing Your Application

Discover your application security risks and vulnerabilities in only a few minutes. In this guide…

17 hours ago

Waymore – A Comprehensive URL Retrieval And Archival Tool For Advanced Reconnaissance

The idea behind waymore is to find even more links from the Wayback Machine than…

17 hours ago

Pycript – A Versatile Burp Suite Extension For Encryption And Decryption

The Pycript extension for Burp Suite is a valuable tool for penetration testing and security…

17 hours ago

DependencyTrack 4.10.0 – Release Overview And Security Hashes

For official releases, refer to Dependency Track Docs >> Changelogs for information about improvements and…

3 days ago