Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bintropy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bintropy

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

  • 1.5.7
  • PyPI
  • Socket score

Maintainers
1

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:

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc