Pentesting Tools

NullGate : Advancing Evasion Techniques In Windows Exploitation

NullGate is a sophisticated project designed to leverage NTAPI functions using indirect syscalls, incorporating the FreshyCalls method with a novel approach to dynamic syscall number retrieval.

It also employs a unique technique to bypass Windows Defender’s memory scanning, making it a powerful tool for process injection.

Key Features Of NullGate

  • Indirect Syscalls: NullGate uses indirect syscalls to invoke NTAPI functions, providing a layer of obfuscation and complexity that can evade detection by security software.
  • Dynamic Syscall Number Retrieval: The project incorporates a method for dynamically retrieving syscall numbers, enhancing its ability to adapt to different environments.
  • Obfuscation Techniques: NullGate includes obfuscation methods such as FNV-1 hashing for function names, which are evaluated at compile-time, making it difficult for reverse engineers to identify the functions being called.
  • Encryption and Encoding: It supports XOR encryption/decryption with multibyte keys and base64 encoding/decoding for payloads or messages, further complicating detection efforts.
  • Shellcode Handling: The tool provides functions to convert hex strings to binary vectors, facilitating the use of shellcode generated by tools like Metasploit’s msfvenom.

NullGate is designed to be easily integrated into projects using CMake’s FetchContent feature. Here’s a basic example of how to include it in a CMakeLists.txt file:

textcmake_minimum_required(VERSION 3.25)
include(FetchContent)

FetchContent_Declare(nullgate
GIT_REPOSITORY https://github.com/0xsch1zo/NullGate
GIT_TAG 1.0.0
)

FetchContent_MakeAvailable(nullgate)

project(test)
add_executable(test main.cpp)
target_link_libraries(test PRIVATE nullgate)

Bypassing Windows Defender Memory Scanning

A significant feature of NullGate is its ability to bypass Windows Defender’s memory scanning. The traditional method involves setting page permissions to PAGE_NOACCESS before creating a thread and then resuming it after the scan.

However, NullGate improves upon this by initially writing junk data to the process memory, creating a suspended thread, and then writing the actual shellcode before resuming the thread.

This approach ensures that the memory is not accessible during the scan, effectively evading detection.

Building And Running NullGate

To build NullGate, use the following commands:

bashgit clone https://github.com/0xsch1zo/NullGate
cd NullGate
cmake . -B build -DNULLGATE_BUILD_SAMPLE=ON
cmake --build build/

The sample executable will be available at <build_dir>/_deps/nullgate-build/sample.exe, which can be used to inject shellcode into a process specified by its PID.

NullGate offers a modern and sophisticated approach to process injection and evasion techniques, making it a valuable tool for those interested in advanced Windows exploitation and evasion strategies.

Its ability to dynamically retrieve syscall numbers and bypass memory scanning makes it particularly effective against modern security solutions.

Varshini

Varshini is a Cyber Security expert in Threat Analysis, Vulnerability Assessment, and Research. Passionate about staying ahead of emerging Threats and Technologies.

Recent Posts

Nmap cheat sheet for beginners

Nmap (Network Mapper) is a free tool that helps you find devices on a network,…

17 hours ago

Understanding the Model Context Protocol (MCP) and How It Works

Introduction to the Model Context Protocol (MCP) The Model Context Protocol (MCP) is an open…

1 week ago

The file Command – Quickly Identify File Contents in Linux

While file extensions in Linux are optional and often misleading, the file command helps decode what a…

1 week ago

How to Use the touch Command in Linux

The touch command is one of the quickest ways to create new empty files or update timestamps…

1 week ago

How to Search Files and Folders in Linux Using the find Command

Handling large numbers of files is routine for Linux users, and that’s where the find command shines.…

1 week ago

How to Move and Rename Files in Linux with the mv Command

Managing files and directories is foundational for Linux workflows, and the mv (“move”) command makes it easy…

1 week ago