BoringLoader
Lab research, Lab environment, benign payload (notepad), no C2/persistence.
Abstract
This post documents a small research project: a custom Windows loader that quietly runs a harmless payload — it opens Notepad — inside another program (explorer.exe). The point was never the payload; it was everything around it. Most of what security software commonly looks for — a suspicious file on disk, telltale program behavior, fingerprints left in memory — was designed around, one deliberate decision at a time; where something is still visible, the post names it. The whole thing is a proof of concept: built for learning and tested in a home lab, not meant to run in the wild, but a good base to build from.
Why?
Existing tools and loaders are easily detected and signatured (though signatures can be bypassed). Making a new one gives full control of everything: we can adapt the loader to the environment we expect to face — how we want to execute, inject, encrypt, obfuscate, what we want to show and hide from analysis, and so on.
That gap is the point: generic rules key on the mapped techniques; the unmapped ones need bespoke behavioral detection.
Most of my research came from books (Evasive Malware, PMAT), existing software/tooling, research blogs, documentation, and general knowledge acquired over the years.
This is purely a proof of concept — not built to be used in the wild, but a good base to build from for the future.
Threat model and scope
- Windows 10/11 as target operating system
- Analysis stack: any EDR solution, with ELK or Wazuh for log aggregation
- Static analysis
- Dynamic analysis
- Target:
explorer.exe— ubiquitous, long-lived, user-session host - Assumption: userland-hooking EDRs; kernel/ETW visibility is present and not bypassed
- Delivery of the initial payload, and the next payload/beacon to be executed, is out of scope. As placeholder we have a payload that opens
notepad.exe
Design & Techniques
High-level architecture

Build-time phase plus three runtime phases — all secrets exist only inside the middle one.
Phase 0 — Build. At compile time we take the payload, LZ4-compress it, and encrypt it with a per-build random 32-byte key (nonce derived from the key). The result is split into 256-byte chunks, hex-encoded, and scattered across a fake config table; the key is split into two cross-masked 16-byte halves.
Cross-masking means neither half is a piece of the key — each half is the key XOR-masked with the other, so they are only meaningful together. Knowing one half tells you nothing about the key (any key value is equally consistent with it), and a hex dump of the binary shows two unremarkable byte arrays rather than key material. This is obfuscation, not cryptography: both halves ship in the same binary, so anyone who reverses one build gets the key — what it defeats is scanning (the halves are not shaped like key material), not reversing. The launcher reverses the masking in memory only, at the moment of use.
This keeps entropy low — encryption and compression raise it a lot — so the launcher’s .data section sits around 3.1 bits/byte (raw ciphertext would be ~7-8). Timestamps are zeroed too (itself an anomaly among real compile timestamps, but the trade against leaking the build window is deliberate).
Phase 1 — Setup. For a generic first pass, the binary gives nothing to grab during static analysis: no imports in the import address table (IAT), no standard libraries, no debug paths. At startup it walks the process’s own module list (PEB, Process Environment Block) to find ntdll, reads the raw syscall numbers out of clean syscall stubs, fills any EDR-hooked stub positionally (stub order matches syscall-number order), and collects a rotating pool of syscall; ret gadgets. So every OS call the launcher makes executes from inside ntdll itself, never through a function a security tool may have hooked or rewired. It then walks the process list by image name (no snapshot APIs) to find explorer.exe. No registry lookups at all — and SeDebugPrivilege is enabled lazily: the process open is tried first, and the privilege is only adjusted if the open comes back access-denied.
Phase 2 — Payload preparation. The sensitive window where secrets exist. The launcher decrypts it with ChaCha20 and unpacks it (LZ4); the decryption secrets are stored in two pieces in the binary, joined at this moment. It creates one memory section visible read-write to itself and read-execute to the target, and builds the payload image by hand — headers, sections, relocations, the payload’s entry point — with no Windows loader involved. The launcher then wipes the plaintext buffer (the payload now exists only in the shared memory), and opens explorer.exe with a single permission to map the views in.
Phase 3 — Handoff, delivery, handshake and exit. Delivery queues an APC onto threads that are already waiting in the target — no new thread is ever created, and the victim thread is only blocked for the (sub-second) duration of the payload’s work. The payload claims a shared control page (first thread wins), sets a status flag, and returns. The victim thread goes back to exactly what it was doing. The launcher watches its own view of that page — no cross-process reads — and on success zeroes the status byte (the claim word stays set as the payload’s no-double-run guard), wipes the decryption-secret pieces and encrypted rows, leaving only harmless decoy strings, then exits by syscall with an unremarkable code. The launcher is gone, and what remains is an unbacked RX region in explorer.exe — invisible to loader telemetry, but precisely the anomaly memory enumeration looks for; module stomping is the planned fix.
But what if every function is hooked?
Positional fill needs some clean neighbors — hook every stub and the arithmetic has no anchors. Real EDRs don’t go that far (it breaks normal software and taxes every process), and one clean stub anywhere is enough to bootstrap. On top of that, every syscall the chain executes is cross-validated at startup against the kernel’s pristine shared copy of ntdll (\KnownDlls — EDR hooks patch our process’s mapped copy, never the section object) and corrected from it, poisoned-stub syscall numbers included. The residual edge is self-bootstrapping: opening \KnownDlls itself needs working syscalls, so a fully poisoned startup set can’t be rescued — but that requires an EDR to hook every stub while leaving the process otherwise functional.
The real ceiling isn’t hooks — kernel telemetry (ETW Threat Intelligence, callbacks) sees every syscall regardless. That limit belongs to the whole approach, not just this implementation.
Known techniques used
- T1106 (Native API)
- T1055 (Process Injection)
- T1055.004 (APC)
- T1027 (Obfuscated Files or Information)
- T1027.007 (Dynamic API resolution)
- T1027.009 (Embedded payload)
- T1027.013 (Encoding/Encryption)
- T1027.015 (Compression)
- T1134 (Access Token Manipulation)
- T1057 (Process Discovery)
Known but unmapped / novel
Textbook, public for years — no MITRE sub-technique applies:
- Manual mapping (public since ~2019)
- Indirect syscall execution with gadget rotation — Hell’s Gate lineage; detection is behavioral (ETW Threat-Intelligence syscall-source heuristics), no MITRE ATT&CK ID exists
- Positional SSN fill for hooked stubs — Halos Gate-style recovery of destroyed syscall numbers from neighboring stubs
- In-memory wipes — no mapped technique, just good hygiene
- Scattering/entropy reduction
Novel techniques:
\KnownDllsSSN cross-validation — pristine syscall numbers stamped over the harvest at every startup, before any chain syscall runs- Split, cross-masked key halves — the decryption key never exists contiguously, on disk or in memory at rest
- Control-page handshake (first-claim-wins, zero cross-process reads)
- No sub-technique under process injection for our section-map variant
What a hook based detection doesn’t see
- No
payload.dllon disk anywhere (embedded, compressed, encrypted) - No file read events at runtime (embed-only)
- No image loads in
explorer.exe(manual map — no ETW loader event, no PEB module entry; kernel image-load callbacks are conceded separately below) - No new threads in
explorer.exe(APC on existing waiters) - No remote
WriteProcessMemory/ protection changes (section dual-map) - No API-name strings or IAT to key rules on
- Memory at rest before/after the run: an encrypted-then-wiped table and decoys
One honest caveat: the chain’s payload is itself a placeholder, and its one Win32 call — spawning notepad.exe from explorer.exe — is the most-instrumented call in the chain. In a lab that odd parent-child pair is instantly visible to any process-tree rule; delivering a real payload is out of scope here (see the threat model).
Detection & Mitigation
YARA / static
Decoy config strings (Locale=en-US etc.) match, but over-match, as those strings appear in real software. The real signature is the table geometry: fixed 512-byte rows (512 hex characters = the 256-byte chunks from phase 0), 1024-byte stride, long pure-hex rows interleaved with short config strings — each followed by NUL padding out to the row width. Signature-able today; per-build decoy randomization would break it.
Behavioral
- APC queued from a foreign process onto wait-state threads
- Cross-process section mapping with no loader events
- Rights-minimal process open followed by a fast exit (~2 s typical lifetime)
- Memory scans during the delivery window find plaintext — but the window is seconds, so it needs a lucky or targeted scan; at rest the launcher is an encrypted-then-wiped table plus decoys. (The payload image in explorer is a different story: unbacked RX, permanent — see the memory-enumeration note above.)
Kernel-side (honest limitation)
Userland hooks are bypassed, but ETW Threat Intelligence and kernel callbacks still observe every syscall. The chain’s defense is shape, not invisibility — the events that fire are ones that look unremarkable on their own.
Mitigations
- Application control (WDAC/AppLocker) on unsigned binaries blocks execution outright
SeDebugPrivilegerestriction (exercised only when the target’s owner requires it)- EDR rules on remote section-map patterns
- Memory scanning cadence vs. the seconds-scale sensitive window
Results
Every phase of the chain is live-verified on Windows: resolution → discovery → decode → map → APC → handshake → wipes → exit, ~2 s typical. The payload opens notepad.exe — instantly verifiable by eye, and failure is obvious. (Current artifact re-verified live end to end, 2026-11-23, including the stamped-KnownDlls SSN correction.)
Stage-coded exits make failure attribution trivial during testing.
Build gates are green on every build: round-trip decode of the embed, skew check against the final artifact, and static allowlists (imports, entropy, plaintext strings, timestamps) — the build fails if the binary gets louder.
Detection-engine validation (EDR) and a YARA rule for this build are planned follow-up work — a follow-up post will cover both, with the EDR protocol defined per product: detected or not, which event/rule fired, what was changed, re-test outcome.
Possible Improvements
- Static legitimacy shell — version resource + manifest (“Update Helper”, plausible vendor) attacks the pre-event prior; currently the launcher is an unsigned, resource-less exe
- Mundane exit code — stage-coded exits are a story; exit 0/1 is boring
- Event spreading — stretch the ~2 s chain to 30–60 s with boring filler like what a real software updater would do (chaff → actions → chaff timing, plaintext-by-design, per-build-randomized values so YARA can’t key on them); breaks window-based correlation scoring
- Decoy imports — the empty IAT is itself an anomaly; adding some imports associated with normal apps like updaters normalizes the profile
- Per-build decoy randomization — the fixed config table (one decoy per ciphertext chunk, drawn from a small pool) is a YARA rule waiting to be made
- Module stomping — map over a legitimately-loaded expendable DLL instead of an anonymous RX region
- OS residue awareness — Prefetch/AmCache record the launcher’s hash regardless of process ephemerality