Custom WinAPI Resolution via PEB Walking Used to Evade AV Detection
Attack Tradecraft · 6 sources · Updated 3mo ago · First seen Apr 16, 2023

Security research and malware-development writeups detailed a Windows evasion technique that avoids standard loader APIs such as GetProcAddress and GetModuleHandle by manually walking the Process Environment Block (PEB) and parsing DLL export tables. The approach resolves modules like kernel32.dll and user32.dll at runtime, including from encrypted strings, to reduce obvious API references in binaries and make static or behavioral detection more difficult. Microsoft’s documentation for GetProcAddress provides the baseline behavior that these custom implementations are designed to replace.
One proof of concept showed a custom GetProcAddress implementation that located MessageBoxA dynamically on Windows 10 x64, while another demonstrated finding kernel32.dll in assembly-style code and resolving exports by hash before allocating memory and launching a benign payload with CreateThread. The authors framed the method as malware and red-team tradecraft, linked it to MITRE ATT&CK T1027, and noted similarities to techniques seen in Conti ransomware source code, underscoring how manual API resolution can help malicious code lower its detection footprint.


