Reducing Binary Entropy
Last updated
Last updated
Entry is the amount of randomness within a data set. As randomness increases, so does entropy. There are many type of entropy. In cybersecurity, we're focused on Shannon's entropy.
The image shows how to utilize entropy while threat hunting.
When picking an encryption, encoding, or any other obfuscation algorithm. It's important to keep entropy in mind, that includes choosing the corrent algorithm but one that isn't too weak.
Another effective method to keeping entropy low is using the obfuscation algorithms.
IPv4fuscation, IPv6fuscation, Macfuscation, and UUIDfuscation** instead of using encryption algorithms**
Another method we can use to reduce entropy is inserting english strings into the final implementation. It's recommended to use either all lower case or all upper case strings** to reduce the number of possibilities for every byte.**
An easy way to reduce entropy is to pad the payloads ciphertext with the same byte repeatedly. Here is a MsfVenom payload before and after appending it with 285 bytes of 0xEA.
drastically dropping entropy from 5.88325
to 3.77597.
The CRT, or C Runtime Library, is a standard interface for the C programming language. The CRT contains a collection of functions & macros. These functions are meant for managing memory, opening and manipulating files, etc. (memcpy, fopen, strcpy).
Removing CRT can drastically reduce the entropy of the final implementation.
Several tools can determine the entropy of a given file such as and .
We can use SciPy's combined with matplotlib to create a visual of entropy.
It's also possible to reduce a payload's entropy using , a tool developed by the MalDev Academy team.
EntropyReducer uses a custom algorithm that utilizes to insert between each byte chunk of the payload.