Turning WerEnc.dll LOLBIN into an attacker-controlled encryption primitive (BYOK)
Windows ships an unused but functional LOLBIN, WerEnc.dll, that implements AES-256+RSA-4096 hybrid encryption for WER artifacts. Researchers reverse-engineered the embedded RSA-4096 public key (4KB blob at RVA 0x5610) and demonstrated a “Bring Your Own Key” (BYOK) technique: patching 539 bytes in memory to swap Microsoft’s public key for an attacker-controlled one, then calling EncryptDumpFile/EncryptDumpStream to produce encrypted output indistinguishable from legitimate WER dumps. The attack bypasses EDR detection (RC4 via SystemFunction033 is flagged; WerEnc loading is undetected), providing red teams and malware a signed, high-entropy encryption primitive with container format mimicking legitimate artifacts.
This post is licensed under CC BY 4.0 by the author.