| Previous: home | Next: tip 2 |
[EDR evasion tip 1/100] - Make your malware look “normally random”

Security tools do not only ask “what does this program do?”
They also ask “does this file look weird on the outside?”
One cheap check is bit entropy: a score of how scrambled and random the bytes look, from about 0 (very patterned) to 8 (almost pure noise). 🎲
- Real code and data are structured. Letters form words. Entropy often sits in a middle band.
- Heavy packing or encryption makes he bytes look chaotic. Entropy climbs toward 8.
Defenders love that spike. A file that looks too random is an easy early flag for “maybe packed / obfuscated malware.”
What large sample sets tend to show 📊
Across big collections of files, a pattern shows up again and again:
- Malware becomes more common than clean software once entropy climbs above ~7.0
- There is also a big cluster of samples around ~4.4 (more “ordinary looking” structure)
So a loader that sits in the very high band stands out next to everyday Windows binaries, even before deeper analysis runs.
The quiet zone for tooling artifacts 🔏
For loaders and similar artifacts, the least suspicious whole-file entropy window is roughly:
4.8 - 6.8
High enough to look like real code and data. Low enough to avoid the “this is basically noise” bucket.
That range is not a free pass. It is one fewer free giveaway.
Practical ways to land in that range 🛠️
You do not need exotic tricks. You need the file as a whole to stop looking like one opaque random blob:
- Prefer light or selective packing over encrypting the entire file when you can
- Mix the high-entropy core with lower-entropy regions (structured padding, repeated patterns, resource-like data) so the average drops
- Keep section layout closer to what normal compilers/linkers produce, instead of one mysterious high-entropy lump
- Measure on every build (per-section and whole-file) and treat 4.8-6.8 as a release check
Takeaway 💡
Entropy is a smell test, not a verdict. Clean files can be high. Malware can be mid.
But if your artifact always screams “maximum randomness,” you are volunteering for the easy filter.
Match legitimate PE-looking ranges first. Save the hard battles for later tips.
Series: EDR evasion / Tip 1 of 100
| Previous: home | Next: tip 2 |