Skip to main content

Bintropy Tweet

Detect packers on PE/ELF/Mach-O files using entropy.

PyPi Python Versions Build Status DOI License

This tool is an implementation in Python of Bintropy, an analysis tool presented in this paper in the scope of packing detection based on entropy. It implements both modes of operation and an additional one, respectively on the entire binary, per section or per segment. It uses the entropy values mentioned in the paper for deciding whether the binary contains compressed/encrypted bytes.

It relies on lief for abstracting either PE, ELF or Mach-O executables. This tool thus supports these three formats.

$ pip install bintropy
$ bintropy --help

Modes of operation

Use the -m/--mode option.

  • 0: full binary (default)
  • 1: per section
  • 2: per segment

Note that mode 2 will logically give results very similar to mode 0.

$ bintropy binary
<<< boolean >>>

$ bintropy binary --dot-not-decide
<<< highest block entropy, average block entropy >>>
$ bintropy binary --mode [1|2]
<<< boolean >>>

$ bintropy binary -m [1|2] --do-not-decide
<<< highest block entropy, average block entropy >>>

Benchmarking

Use the -b/--benchmark option to get one more value, the processing time in seconds.

$ bintropy binary -b
<<< boolean, processing time >>>

$ bintropy binary -b --do-not-decide
<<< highest block entropy, average block entropy, processing time >>>

Overriding default entropy values

The reference paper uses 6.677 for the average block entropy and 7.199 for the highest block entropy (obtained by analyzing a dataset of PE files and using the first mode of operation). These values can be overriden with the dedicated options.

$ bintropy binary --threshold-average-entropy 5.678 --threshold-highest-entropy 6.789
[...]

Plotting

This tool features plot generation for drawing binary's sections and the entropy within.

$ bintropy binary --plot
<<< boolean >>>

Example of generated figures:

You may also like these:

Metadata

Release files for bintropy 1.5.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bintropy 1.5.7
File Size Uploaded
bintropy-1.5.7.tar.gz 186.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bintropy 1.5.7
File Interpreter ABI Platform
bintropy-1.5.7-py3-none-any.whl Python 3 none any Details

Total release size: 226.6 kB

Release files / bintropy-1.5.7.tar.gz

Download URL bintropy-1.5.7.tar.gz
Size 186.9 kB
Tags Source
SHA-256 checksum
How to use checksums
98de18115affda73a41d83157f28d20e95c0a624559f7c34d298043650f86a87
BLAKE2b-256 checksum
How to use checksums
931678ee9c761c3021df1c9c86062e3f8b2db6096d4b54003060222998ed1b09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / bintropy-1.5.7-py3-none-any.whl

Download URL bintropy-1.5.7-py3-none-any.whl
Size 39.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d974407c616b2c4ccb38c93b5a0531156273b68e9d85c08d23edafd24114e3d
BLAKE2b-256 checksum
How to use checksums
2bc21ebcf2da87dc7cfbbc3240166609be735c953234322042d8194c534dff08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

1.5.7 This release

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.0

2 release files

1.4.9

2 release files

1.4.8

2 release files

1.4.7

2 release files

1.4.6

2 release files

1.4.5

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.7

1 release file

1.2.6

1 release file

1.2.5

1 release file

1.2.4

1 release file

1.2.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page