Skip to main content

entropystrip

___________       __                               _________ __         .__        
\_   _____/ _____/  |________  ____ ______ ___.__./   _____//  |________|__|_____  
 |    __)_ /    \   __\_  __ \/  _ \\____ <   |  |\_____  \\   __\_  __ \  \____ \ 
 |        \   |  \  |  |  | \(  <_> )  |_> >___  |/        \|  |  |  | \/  |  |_> >
/_______  /___|  /__|  |__|   \____/|   __// ____/_______  /|__|  |__|  |__|   __/ 
        \/     \/                   |__|   \/            \/                |__|    

What it does

Most modern malware hides behind packers (like UPX, VMProtect, or Themida) or stashes encrypted payloads in PE resource directories or trailing file overlays. Rather than relying on static byte signatures, entropystrip evaluates:

  1. Section Entropy: Calculates block-level Shannon entropy across every PE section to locate encrypted or compressed buffers ($H > 7.20$).
  2. Memory Permissions: Identifies sections marked simultaneously as Writable and Executable (IMAGE_SCN_MEM_WRITE and IMAGE_SCN_MEM_EXECUTE), which indicates self-modifying code or runtime unpackers.
  3. PE Overlays: Measures trailing bytes appended past the end of the last mapped section.
  4. Import Table Size & Composition: Flags binaries with unusually small IATs (e.g. only importing LoadLibrary / GetProcAddress) or sensitive process injection primitives (VirtualAlloc, WriteProcessMemory, QueueUserAPC).
  5. .NET Classification: Inspects the COM descriptor directory to separate managed CLR assemblies from native binaries, avoiding false positives on standard C# applications.
  6. Payload Carving: Extracts identified high-entropy sections or overlays straight to raw binary files on disk for further analysis.
  7. Directory Triage: Walks directories or drives and ranks all found binaries by threat score.

Installation

Requirements: Python 3.8+ on Windows, Linux, or macOS.

pip install entropystrip

Or install directly from source:

git clone https://github.com/dwexi/entropystrip.git
cd entropystrip
pip install -e .

Usage

usage: entropystrip [-h] [-r] [--dump] [--deep] [--html HTML] [--json JSON] target

EntropyStrip: PE De-obfuscator & Triage Engine

positional arguments:
  target         Path to Windows executable (.exe / .dll) or directory to scan

options:
  -h, --help     show this help message and exit
  -r, --recursive
                 recursively scan subdirectories if target is a folder
  --dump         carve and write high-entropy payloads to extracted_payloads/
  --deep         deep forensic triage: MITRE ATT&CK mapping, entry point disassembly, hashes
  --html HTML    write minimalist HTML report to specified path
  --json JSON    write machine-readable JSON telemetry to specified path

Examples

Analyze a single binary:

python main.py target.exe

Deep forensic triage with MITRE ATT&CK mapping & disassembly:

python main.py suspicious.exe --deep

Analyze and extract hidden payload buffers:

python main.py suspicious.exe --dump

Carved payloads are written to extracted_payloads/<target>_<section>.bin.

Export a standalone HTML report:

python main.py sample.exe --html report.html

Triage an entire directory of unknown files:

python main.py "C:\IncidentTriage" -r

Entropy Scale Reference

Shannon entropy measures information density from 0.00 to 8.00 bits per byte:

$$H(X) = -\sum_{i=0}^{255} P(x_i) \log_2 P(x_i)$$

Entropy Range Expected Content Notes
0.00 - 2.00 Zero-padding, sparse tables Common in uninitialized data or alignment padding
2.00 - 5.50 Standard ASCII, configurations Normal application metadata, strings
5.50 - 6.60 Native compiled machine code Standard x86/x64 instructions (.text)
6.60 - 7.30 Compressed assets Bitmaps, icons, zlib/deflate streams
7.40 - 8.00 Cryptographic ciphertext AES/RC4 encrypted payloads or tightly packed shellcode

License

MIT License. See LICENSE for details.

Metadata

Release files for entropystrip 1.1.0

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

Source distribution (sdist)

Source distribution for entropystrip 1.1.0
File Size Uploaded
entropystrip-1.1.0.tar.gz 19.1 kB Details

Built distribution (wheel)

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

Total release size: 36.6 kB

Release files / entropystrip-1.1.0.tar.gz

Download URL entropystrip-1.1.0.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0439554d9d570c2af4c8594a3916b29af09cbd94c9e77ba6428e54b8df7eea68
BLAKE2b-256 checksum
How to use checksums
d86f4c8583f67a513dd2ce99a6251f8b1165080079326b7810e8bdad6fe519e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release files / entropystrip-1.1.0-py3-none-any.whl

Download URL entropystrip-1.1.0-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75dd58f74b7b07a1ff64f9fe56bfe86dded13023365d6bae006cb318f380f385
BLAKE2b-256 checksum
How to use checksums
18a9d0fefedfff79138dd21ee9d977b35f86bf46dca8cc7cbe0f4547a937b04e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release history Release notifications | RSS feed

1.2.0

2 release files

This release

1.1.0 This release

2 release files

1.0.0

2 release files

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