Skip to content

Instantly share code, notes, and snippets.

@stvemillertime
Forked from tlansec/entropy.yar
Created September 26, 2022 00:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stvemillertime/f24c414e9ff15cc2e605fb0f0d802295 to your computer and use it in GitHub Desktop.
Save stvemillertime/f24c414e9ff15cc2e605fb0f0d802295 to your computer and use it in GitHub Desktop.
Print out information about a files entropy
// Add as an alias like:
// alias entropy=yara /path/to/entropy.yar $*
// Usage:
// entropy file.bin
import "console"
import "math"
rule entropy
{
condition:
console.log(math.entropy(0, filesize))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment