Skip to main content

Analysis tool for estimating the likelihood that a binary contains compressed or encrypted bytes

Project description

PyPi Build Status Python Versions Requirements Status Known Vulnerabilities License

Introduction

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, either on the entire binary or per section. 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.

Setup

This tool is available as a package from PyPi.

$ pip install bintropy

Usage

The help message explains every option.

$ bintropy --help

Per-section operation mode

For this mode, do not use the -f/--full option. Moreover, you can use the --dot-not-decide option to prevent the tool from returning the boolen but the entropy values instead.

$ bintropy binary
<<< boolean >>>

$ bintropy binary --dot-not-decide
<<< highest block entropy, average block entropy >>>

Full-binary operation mode

For this mode, use the -f/--full option. Moreover, you can use the --dot-not-decide option to prevent the tool from returning the boolen but the entropy values instead.

$ bintropy binary -f
<<< boolean >>>

$ bintropy binary -f --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
<<< boolean, processing time >>>

$ bintropy binary -f --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. These values can be overriden with the dedicated options.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bintropy-1.1.0.tar.gz (19.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page