InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Follow publication

Member-only story

Exploring Antivirus and EDR evasion techniques step-by-step. Part 3

Reading into Direct Syscalls with Syswhispers.

bob van der staak
InfoSec Write-ups
Published in
16 min readNov 21, 2023

--

Now that we have a better understanding of syscalls and know the chain from application ==> Windows Api ==> Native Windows Api. It is time to really implement the bypass by making use of Direct Syscalls.

But first, let's dive a tiny bit deeper into the code we already created in Part 1. We gonna use WinDBG to investigate the code of the native Windows API. We will focus specifically on the NtAllocateVirtualMemory native Windows function And what these instructions look like in assembly!
I am interested if this changes after our use of Syswhispers!

Understanding the Assembly Code for NtAllocateVirtualMemory in WinDBG

Assembly code can be intimidating at first, but with some guidance, we can break it down step by step to understand what’s happening. First, we want to use Windbg.

WinDbg is a kernel-mode and user-mode debugger that’s included in Debugging Tools for Windows

So we gonna use that tool to debug and view the code steps our native Windows API makes especially focusing on one instruction. The ntAllocateVirtual memory function. This can be performed by executing the following command:

u ntdll!NtAllocateVirtualMemory. Let's analyze the code line by line.

--

--

Published in InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Written by bob van der staak

An enthousiastic ethical hacker and security researcher

No responses yet

Write a response