Skip to main content

entropystrip

PyPI version Python versions License: MIT

A fast CLI tool for Windows PE triage, sliding-window entropy analysis, and detecting concealed payloads in loaders and crypters.

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

Why EntropyStrip?

Most quick-triage tools compute Shannon entropy across entire PE sections or whole files. Attackers exploit this averaging effect in modern loaders:

  • Dilution by size: Stashing 20 KB of encrypted shellcode inside a 1 MB .rdata section padded with zeros keeps the section-wide entropy below 5.5.
  • Dilution by padding: Interleaving ciphertext with NOP sleds (0x90) or repeating delimiters pulls the score down to benign code levels.
  • String staging: Converting shellcode into UUID arrays (UuidFromStringA) or IPv4 addresses (RtlIpv4StringToAddressA) keeps disk entropy around 4.0 until runtime reassembly.

EntropyStrip addresses these blind spots with sub-section analysis and structural checks.


Key Capabilities

  • Sliding-window inspection: Scans sections and overlays in 1024-byte and 256-byte windows with adaptive stepping to catch concentrated payloads regardless of total section size.
  • Dilution and Chi-Square checks: Evaluates modal byte distribution and opcode uniformity to flag padded ciphertext.
  • Memory staging detection: Identifies UuidFromString and RtlIpv4StringToAddress staging primitives and clusters of formatted UUID strings.
  • YARA signature engine: Integrates default threat rules (Cobalt Strike beacons, ransomware shadow copy deletion, reflective loaders, shellcode egg hunters) and custom rules via --yara [PATH]. Includes a pure-Python fallback scanner for zero-dependency execution.
  • Deep PE Resource (.rsrc) tree: Recursively inspects resource entries, flags embedded PE/MZ executables (resource steganography / T1027), and carves encrypted RT_RCDATA payloads.
  • Export table (EAT) & DLL side-loading triage: Detects DLL proxying/forwarding and flags binaries masquerading as known Windows system DLLs (T1574.002).
  • MalwareBazaar threat intelligence: Opt-in hash reputation lookup via --bazaar to classify malware families, community tags, and VirusTotal detection rates without leaking forensic telemetry by default.
  • Pure-Python fuzzy hashing (SSDEEP/CTPH) & campaign clustering: Computes rolling piecewise hashes with zero C-dependencies and groups related binaries into automated campaign clusters during directory triage.
  • Memory permissions: Flags self-modifying code in sections marked both Writable and Executable (W+X).
  • Authenticode and installer verification: Validates PE WIN_CERTIFICATE directory bounds and NSIS 0xdeadbeef headers so signed software and installers are not falsely scored.
  • Rich Header inspection: Detects stripped or invalid MSVC Rich Headers in native binaries.
  • Payload carving: Use --dump to extract suspicious buffers directly to disk for Ghidra or x64dbg.
  • Directory triage: Pass a folder path to scan directories and rank binaries on an incident triage leaderboard.

Installation

Requires Python 3.8+ on Windows, Linux, or macOS.

pip install entropystrip

Or install from source:

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

Usage

usage: entropystrip [-h] [-v] [-r] [--dump] [--deep] [-i] [--install]
                    [--uninstall] [--html HTML] [--json JSON]
                    [--yara [RULE_PATH]] [--bazaar] [--bazaar-key KEY]
                    [target]

EntropyStrip: PE De-obfuscator, Shannon Entropy Radar, and Incident Triage Engine

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

options:
  -h, --help          show this help message and exit
  -v, --version       Show program's version number and exit
  -r, --recursive     Recursively scan subdirectories
  --dump              Carve high-entropy payloads to extracted_payloads/
  --deep              Deep forensic triage: MITRE ATT&CK mapping, entry point disassembly, hashes
  -i, --interactive   Launch interactive triage wizard
  --install           Install EntropyStrip globally to Windows PATH
  --uninstall         Uninstall EntropyStrip from Windows PATH
  --html HTML         Path to write standalone HTML report
  --json JSON         Path to write machine-readable JSON telemetry
  --yara [RULE_PATH]  Scan with YARA rules (uses bundled threats.yar by default, or custom file/dir)
  --bazaar            Query MalwareBazaar (abuse.ch) for sample hash intelligence and signatures
  --bazaar-key KEY    MalwareBazaar API Auth-Key (overrides MALWAREBAZAAR_API_KEY environment variable)

Examples

Analyze a single binary with YARA scanning:

entropystrip target.exe --yara

Scan with custom YARA rules and query MalwareBazaar threat intel:

entropystrip suspicious.exe --yara my_rules.yar --bazaar

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

entropystrip suspicious.exe --deep

Extract hidden payload buffers and embedded resources:

entropystrip suspicious.exe --dump

Carved payloads are written to extracted_payloads/payload_<sha256>_sec<index>_<section>.bin.

Export a standalone HTML report:

entropystrip sample.exe --html report.html

Triage an entire directory with automated campaign clustering:

entropystrip "C:\IncidentTriage" -r --html incident_report.html

Entropy Reference

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

Entropy Range Typical Content Notes
0.00 - 2.00 Zero-padding, sparse tables Alignment padding, uninitialized buffers
2.00 - 5.50 Standard ASCII, configurations Application metadata, readable 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 Encrypted payloads or packed shellcode

License

MIT License. See LICENSE for details.

Metadata

Release files for entropystrip 1.3.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.3.0
File Size Uploaded
entropystrip-1.3.0.tar.gz 59.4 kB Details

Built distribution (wheel)

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

Total release size: 123.7 kB

Release files / entropystrip-1.3.0.tar.gz

Download URL entropystrip-1.3.0.tar.gz
Size 59.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9a79a319ce4bbd3f25436c9f4f1fec577fcd6139217a03fc63f4f7c6bb3d5689
BLAKE2b-256 checksum
How to use checksums
b9b34c1eb450f87dfd063f14c1b090b7a42cf1105b492f0f4dbaf9a5c56cd1db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

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

Download URL entropystrip-1.3.0-py3-none-any.whl
Size 64.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a4c21b0c0f91bc1ca63ed016fd998ba2e9c04eadab391438ecdf3f3aa74eeceb
BLAKE2b-256 checksum
How to use checksums
e5d41de7b17ae29efecef70536eaf0009d3981a259bde4d0e39b9febb3254a7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

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