Skip to main content
Mallory
← Back to News
payload-delivery-evasiondefense-evasion-methodoffensive-tooling-releaseadversary-emulation-tradecraft

Custom WinAPI Resolution via PEB Walking Used to Evade AV Detection

Attack Tradecraft · 6 sources · Updated 3mo ago · First seen Apr 16, 2023

Custom WinAPI Resolution via PEB Walking Used to Evade AV Detection

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.

Who uses this technique?Get the actors, campaigns, and ATT&CK mapping behind it.
Get the tradecraft
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

4 events · Jul 30, 2021 – Apr 16, 2023
  1. Apr 16, 20234y ago

    Custom GetProcAddress evasion technique published

    A follow-up tutorial published a custom GetProcAddress implementation that manually parses a module's export table and pairs it with a custom GetModuleHandle routine that walks the PEB. The sample resolved user32.dll and MessageBoxA from encrypted strings at runtime as an AV-evasion technique on Windows 10 x64.

    Malware AV/VM evasion - part 16: WinAPI GetProcAddress implementation. Simple C++ example. - cocomelonc
  2. Apr 8, 20234y ago

    Custom GetModuleHandle PEB-walking evasion technique published

    A tutorial published a custom GetModuleHandle implementation that walks the PEB loader module list to locate loaded DLLs without calling the WinAPI directly. The Windows 10 x64 PoC decrypted user32.dll and MessageBoxA at runtime, resolved the function with GetProcAddress, and displayed a message box as an AV-evasion demonstration.

    Malware AV/VM evasion - part 15: WinAPI GetModuleHandle implementation. Simple C++ example. - cocomelonc
  3. Apr 2, 20225y ago

    PEB-walking API resolution technique demonstrated in C++ PoC

    A tutorial presented a malware-relevant Windows technique for locating kernel32.dll via the PEB and resolving exports by hash, then using the resolved APIs to allocate memory and execute a benign message-box shellcode payload. The post said the trick had been observed in Conti ransomware source code and was demonstrated on Windows 10 x64.

    Malware development tricks. Find kernel32.dll base: asm style. C++ example. - cocomelonc
  4. Jul 30, 20215y ago

    Shellcode lab shows manual kernel32 and WinExec resolution

    A technical lab demonstrated how Windows x86 shellcode can traverse the TEB and PEB loader structures to find kernel32.dll in memory, manually parse its export table, resolve WinExec, and invoke it to launch calc.exe. The article presented the technique as a foundational method for resolving APIs such as GetProcAddress and LoadLibrary at runtime.

    Finding Kernel32 Base and Function Addresses in Shellcode | Red Team Notes
Linked entities

Related entities

Vulnerabilities, threat actors, malware, products, organizations, breaches, and observables Mallory has linked to this story. Indicator values are masked here and available in full in the app.

Open in app →

Affected products

1 linked
Windows

Observables

1 linked

Indicator values are masked on this page. See the values in Mallory Domains, IPs, hashes, and URLs are exportable to your SIEM.

Do you run this?Get the adversaries, campaigns, and ATT&CK mapping behind this technique, with detections ready to deploy.
See Who Uses This Technique
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.