Windows Internals & Malware Development Guide
All 91 Core Modules, 38 Advanced PDF Modules, 249 interactive learning objectives, 700+ diagrams, and 99 companion C/C++/ASM code archives in one fast static app.
01 · Foundations & Windows Internals
12Welcome Module
Welcome to MalDev Academy! An introductory module to familiarize yourself with the module layout.
Introduction To Malware Development
An introduction to the malware development life cycle.
Required Tools
The required tools that will be used throughout the course.
Coding Basics
Fundamental C concepts that are necessary to understand for the course.
Windows Architecture
Introduction to the function call flow, different subsystem DLLs and the NTAPI.
Windows Memory Management
Explaining the different Windows memory types how the OS manages memory.
Introduction To The Windows API
An introduction to the Windows API, the common data types, ANSI vs Unicode functions, in and out parameters and debugging.
Portable Executable Format
An introduction to the portable executable format from a programming perspective.
Dynamic-Link Library
An introduction to Dynamic-Link Libraries, how they operate, their uses, and how they're created.
Detection Mechanisms
An introduction to the different ways malware can be detected.
Windows Processes
An introduction to the internal workings of Windows processes.
Undocumented Structures
Finding and using undocumented structures that go beyond Microsoft's official documentation.
02 · Payload Placement, Encryption & Obfuscation
13Payload Placement - .data & .rdata Sections
Storing payloads in the .data & .rdata sections of a portable executable file.
Payload Placement - .text Section
Storing payloads in the .text section of a portable executable file.
Payload Placement - .rsrc Section
Storing payloads in the .rsrc section of a portable executable file.
Introduction To Payload Encryption
An introduction to payload encryption algorithms covered in this course, why they're necessary and encryption advantages and disadvantages.
Payload Encryption - XOR
Demonstrating multiple ways of using XOR to encrypt a payload.
Payload Encryption - RC4
Demonstrating multiple ways of using RC4 to encrypt a payload.
Payload Encryption - AES Encryption
Demonstrating multiple ways of using AES to encrypt a payload.
Evading Microsoft Defender Static Analysis
Using encryption methods to bypass Microsoft Defender's static analysis engine.
Payload Obfuscation - IPv4/IPv6Fuscation
Obfuscating payloads by transforming them into IPv4/IPv6 addresses.
Payload Obfuscation - MACFucscation
Obfuscating payloads by transforming them into MAC addresses.
Payload Obfuscation - UUIDFuscation
Obfuscating payloads by transforming them into UUIDs.
Maldev Academy Tool - HellShell
Demonstrating a tool that performs encryption & obfuscation using the methods discussed in previous modules.
Maldev Academy Tool - MiniShell
Demonstrating a tool that performs RC4 & AES encryption.
03 · Local Execution, Injection & Staging
7Local Payload Execution - DLL
Loading a malicious DLL file in the local process.
Local Payload Execution - Shellcode
Running malicious shellcode in the local process.
Process Injection - DLL Injection
Performing process enumeration & DLL injection on a remote process.
Process Injection - Shellcode Injection
Performing process enumeration & shellcode injection on a remote process.
Payload Staging - Web Server
Retrieving a payload that's stored on a remote HTTP server.
Payload Staging - Windows Registry
Reading and writing a payload to the Windows Registry.
Malware Binary Signing
Reducing signatures on a malicious binary by signing it with a certificate.
04 · Enumeration, Thread Hijacking, APC & Spoofing
17Process Enumeration - EnumProcesses
Enumerating processes using the EnumProcesses WinAPI.
Process Enumeration - NtQuerySystemInformation
Enumerating processes using the NtQuerySystemInformation NTAPI.
Thread Hijacking - Local Thread Creation
Hijacking a locally created sacrificial thread to execute a payload.
Thread Hijacking - Remote Thread Creation
Hijacking a remotely created sacrificial thread to execute a payload.
Thread Hijacking - Local Thread Enumeration
Hijacking a local sacrificial thread to execute a payload without thread creation.
Thread Hijacking - Remote Thread Enumeration
Hijacking a remote sacrificial thread to execute a payload without thread creation.
APC Injection
Executing a payload using APC injection.
Early Bird APC Injection
Executing a payload using Early Bird APC Injection.
Callback Code Execution
Using a variety of callback functions to execute a payload.
Local Mapping Injection
Performing mapping injection on the local process.
Remote Mapping Injection
Performing mapping injection on a remote process.
Local Function Stomping Injection
Overwriting a local function's logic to have it execute a malicious payload.
Remote Function Stomping Injection
Overwriting a remote function's logic to have it execute a malicious payload.
Payload Execution Control
Using semaphores, mutexes, and events to control the payload's execution.
Spoofing PPID
Spoofing the parent process ID of a malicious process.
Process Argument Spoofing (1)
Spoofing a process's malicious arguments.
Process Argument Spoofing (2)
Spoofing a process's malicious arguments using a different technique.
05 · PE Parsing, String Hashing & IAT Obfuscation
8Parsing PE Headers
Parsing a portable executable's headers to extract useful information.
String Hashing
Demonstrating several string hashing algorithms to obfuscate strings.
IAT Hiding & Obfuscation - Introduction
Introduction to Import Address Table hiding.
IAT Hiding & Obfuscation - Custom GetProcAddress
Creating and using a custom version of the GetProcAddress WinAPI.
IAT Hiding & Obfuscation - Custom GetModuleHandle
Creating and using a custom version of the GetModuleHandle WinAPI.
IAT Hiding & Obfuscation - API Hashing
Using API hashing to hide imported WinAPIs from the Import Address Table.
IAT Hiding & Obfuscation - Custom Pseudo Handles
Creating and using custom version of pseudo handles functions.
IAT Hiding & Obfuscation - Compile Time API Hashing
Using compile time API hashing to dynamically generate hashes and avoid signatures.
06 · API Hooking
5API Hooking - Introduction
Introduction to API hooking, how it's done and why it's done.
API Hooking - Detours Library
Performing API hooking using the Detours library.
API Hooking - Minhook Library
Performing API hooking using the Minhook library.
API Hooking - Custom Code
Performing API hooking using a custom built function.
API Hooking - Using Windows APIs
Performing API hooking using WinAPIs.
07 · Direct Syscalls
7Syscalls - Introduction
Introduction to syscalls, why they're used, Zw/Nt syscalls, Syscall service numbers and syscall structures.
Syscalls - Userland Hooking
Demonstrating how EDRs perform userland hooking and what how these hooks can be bypassed.
Syscalls - SysWhispers
Using and comparing SysWhispers, SysWhispers2, and SysWhispers3.
Syscalls - Hell's Gate
Explaining and using the Hell's Gate technique to perform direct syscalls.
Syscalls - Reimplementing Classic Injection
Reimplementing classic injection using syscalls instead of WinAPIs.
Syscalls - Reimplementing Mapping Injection
Reimplementing mapping injection using syscalls instead of WinAPIs.
Syscalls - Reimplementing APC Injection
Reimplementing APC injection using syscalls instead of WinAPIs.
08 · Anti-Analysis, Entropy & AV Evasion
12Anti-Analysis - Introduction
Introduction to anti-analysis, anti-debugging and anti-virtualization.
Anti-Debugging - Multiple Techniques
Detecting debuggers using various techniques.
Anti-Debugging - Self-Deletion
Perform self-deletion when a condition is met.
Anti-Virtual Environments - Multiple Techniques
Detecting virtualized environments using various techniques.
Anti-Virtual Environments - Multiple Delay Execution Techniques
Detecting virtualized environments using various timing techniques.
Anti-Virtual Environments - API Hammering
Performing API hammering to to delay execution in virtualized environments.
Binary Entropy Reduction
Using several methods to reduce a binary's entropy to thwart detection.
Brute Force Decryption
Brute forcing the decryption key to avoid hardcoding into the binary.
MalDev Academy Tool - KeyGuard
Demonstrating a tool that generates an encryption key, encrypts it and brute forces it during runtime.
CRT Library Removal & Malware Compiling
Modifying Visual Studio's default compiler settings to enhance an implementation's stealth.
IAT Camouflage
Manipulating the Import Address Table to make unused benign functions appear.
Bypassing AVs
Using a combination of previously discussed techniques to create an evasive payload loader.
09 · EDRs, NTDLL Unhooking & Indirect Syscalls
10Introduction To EDRs
Introduction to EDRs and how they detect malware.
NTDLL Unhooking - Introduction
Introduction to NTDLL unhooking, text section alignment, the on-disk vs in memory offset and the various unhooking methods that will be discussed.
NTDLL Unhooking - From Disk
Performing NTDLL unhooking by reading a clean version of NTDLL from disk.
NTDLL Unhooking - From KnownDlls Directory
Performing NTDLL unhooking by accessing it from the KnownDlls directory.
NTDLL Unhooking - From a Suspended Process
Performing NTDLL unhooking by reading it from a suspended process.
NTDLL Unhooking - From a Web Server
Performing NTDLL unhooking by retrieving a clean version from Winbindex.
Updating Hell's Gate
Updating Hell's Gate to retrieve a syscall's SSN using the TartarusGate approach.
Indirect Syscalls - HellsHall
Bypassing EDRs through the use of indirect syscalls.
Block DLL Policy
Blocking non-Microsoft DLLs from being injected into the implementation.
Diving Into NtCreateUserProcess
Utilizing NtCreateUserProcess for enhanced process creation.
10 · Advanced Tradecraft & Hardware Breakpoints
11Binary Metadata Modification
Binaries can include metadata that provides information about the file such as a file description, version number, company name and more. The image below shows the metadata of G...
Thread Enumeration - NtQuerySystemInformation
In a previous module, the process of enumerating a system's threads was demonstrated using the snapshot WinAPIs. The Thread Hijacking Remote Thread Enumeration module, for exa...
Custom WinAPI Functions
In the IAT Hiding & Obfuscation Custom Pseudo Handles module, it was demonstrated that creating custom WinAPIs is a preferable approach over dynamically importing them (if pos...
Exploiting EDRs For Evasion
This module showcases a 0-day vulnerability in a widely-used EDR, and building a functional shell that successfully circumvents the EDR's detection.
Introduction To MASM Assembly
Assembly language is a low-level programming language used to create programs that directly control a computer's hardware, such as its CPU and memory. This language is composed ...
Evasion With File Bloating
File bloating is an evasion technique where a malicious file is inflated with junk data, usually by appending a large number of null bytes to the end of the file. This has been ...
Bring Your Own Protocol Handler
This module will introduce a new initial access technique which will be referred to as "Bring Your Own Protocol Handler". This is a variation of a technique that was previously ...
Bring Your Own File Extension
This module will introduce a new initial access technique which has been dubbed by the Maldev Academy team as "Bring Your Own File Extension". The concepts presented in this mod...
Utilizing Hardware Breakpoints For Hooking (1)
In previous modules, hooks were implemented using trampolines by patching the original execution flow with unconditional jump shellcodes. The unconditional jump causes the execu...
Utilizing Hardware Breakpoints For Hooking (2)
In the previous module, the main emphasis was on comprehending the utilization of hardware breakpoints for patchless API hooking. While the initial code presented was functional...
Utilizing Hardware Breakpoints For Credential Dumping
In the previous module, hardware breakpoints were utilized to apply patchless user-land API hooking through a stable library. In this module, the same library will be used to ha...
11 · ETW & AMSI Internals & Bypasses
9Event Tracing For Windows - Introduction
Event Tracing for Windows or ETW, is a powerful tracing mechanism built into the Windows OS which allows for collecting detailed information about events and activities that occ...
Event Tracing For Windows - ETW Tools
The previous module introduced covered theoretical concepts surrounding ETW architecture, components and their functionality. This module will introduce several tools that allow...
Event Tracing For Windows - ETW Bypass Via Byte Patching
The earlier modules laid the groundwork for comprehending ETW and its various components. Building on that knowledge, it is now possible to dive into the topic of ETW evasion. T...
Event Tracing For Windows - Improved Patching
The previous module showed a simple function to patch EtwEventWrite and EtwEventWriteFull and NtTraceEvent to prevent events from reaching the ETW tracing session. This module w...
Event Tracing for Windows - Patchless ETW Bypass Via HBPs
In the previous module, the target functions were patched by employing shellcode to prevent the execution of the EtwpEventWriteFull function. While this method proves effective,...
Event Tracing For Windows - ETW Provider Session Hijacking
In earlier modules, the primary focus was targeting specific ETW functions to prevent events from being recorded in the tracing session. However, an alternative approach called ...
Antimalware Scan Interface - Introduction
Antimalware Scan Interface or AMSI for short, is a Windows feature that provides a standard interface between the OS and the installed antimalware vendor. AMSI is designed to in...
Antimalware Scan Interface - AMSI Bypass Via Byte Patching
In the previous module, AMSI was introduced and it was shown how it can be used to prevent malicious scripts from being executed through signature scans. It was also shown that ...
Antimalware Scan Interface - Patchless AMSI Bypass Via HBPs
In the previous module, patching AMSI's WinAPIs was discussed as a method to bypass AMSI. However, as mentioned in several patching modules throughout the course, this approach ...
12 · Loaders, C2, DLL Sideloading & BYOVD
7Building a DRM-equipped Malware
Throughout the Maldev Academy modules, various anti-analysis techniques have been demonstrated. These techniques assess the legitimacy of a machine by examining its configuratio...
Introduction to Havoc C&C
Havoc is a modern, malleable post-exploitation command and control framework made for penetration testers, red teams, and blue teams. It's free and open source and available on ...
Building An Evasive DLL Payload Loader
Leading up to this module, the course has covered various individual evasion techniques but hasn't integrated them into practical real-world projects. However, in this module, r...
Introduction To DLL Sideloading
DLL Sideloading is a method that abuses the Dynamic-link library search order which defines the specific order that the operating system searches for and loads DLL files when a ...
Practical DLL Sideloading Example
In the preceding module, the DLL sideloading technique was introduced as an opsec strategy for loading payloads. It's essential to note that because the binary sideloaded in the...
DLL Sideloading For EDR Evasion
DLL sideloading can serve as an effective technique when evading security solutions. Security solutions are far better tuned to detect malicious EXEs and have the capacity to sc...
Bring Your Own Vulnerable Driver (BYOVD)
Drivers are software components that enable communication and interaction between hardware devices (such as printers, graphics cards, and network adapters) and the OS of a compu...
13 · Advanced PE Injection, Packers & Evasion
11Local PE Injection
Up until this point in the course, the payloads utilized have consistently been position-independent shellcodes. These payloads are designed for improved compatibility and flexi...
Reflective DLL Injection
As demonstrated in the previous module, injecting a PE payload requires following multiple steps that replicate the actions of the Windows loader when executing a PE image. Howe...
PeFluctuation
In the previous module, Local PE Injection, the PE payload was executed without implementing memory evasion strategies after running the entry point. This exposed our PE payload...
Building A PE Packer
Unlike the previous PE injection modules which were more like PoCs for learning purposes, this module will integrate Local PE Injection and PeFluctuation modules to create a PE ...
Malware Directory Placement
When dropping a malicious executable, one must be aware of where the malware is being dropped or executed. For example, a sample initial access scenario would be a .lnk that run...
Utilizing Fibers For Payload Execution
Up until this module, utilizing threads was the primary mechanism used for executing functions and tasks within a process. Nevertheless, an alternative method exists using Fibers.
TLS Callbacks For Anti-Debugging
Thread Local Storage TLS callbacks were first introduced in the Local PE Injection module. TLS callbacks are a set of callback functions specified within the TLS directory of ...
Threadless Injection
Threadless Injection is a relatively new injection technique that operates in a way similar to Function Stomping which executes the shellcode when the stomped function is called.
Module Stomping
Module Stomping is a code injection technique where the shellcode is injected into the .text section of a legitimate sacrificial DLL file. This injection technique does not use ...
Module Overloading
In the previous module, the code injection technique "Module Stomping" was introduced and demonstrated. Recall that Module Stomping uses a sacrificial DLL file and overwrites pa...
Process Hollowing
Process Hollowing is an injection technique that injects PE payloads into the address space of a remote process. The remote process is often a suspended child process created by...