___________ __ _________ __ .__
\_ _____/ _____/ |________ ____ ______ ___.__./ _____// |________|__|_____
| __)_ / \ __\_ __ \/ _ \\____ < | |\_____ \\ __\_ __ \ \____ \
| \ | \ | | | \( <_> ) |_> >___ |/ \| | | | \/ | |_> >
/_______ /___| /__| |__| \____/| __// ____/_______ /|__| |__| |__| __/
\/ \/ |__| \/ \/ |__|
大多数现代恶意软件隐藏在加壳器、混淆加载器或加密的暂存器之后,旨在绕过简单的全文件熵扫描器。entropystrip 不依赖静态字节签名,而是评估以下内容:
UuidFromString、RtlIpv4StringToAddress)并检测格式化 UUID shellcode 簇。IMAGE_SCN_MEM_WRITE 和 IMAGE_SCN_MEM_EXECUTE)。WIN_CERTIFICATE Authenticode 表进行结构验证,以区分真实证书与投放器。T1027、T1027.001、T1027.002、T1055、T1497、T1129)。0xdeadbeef)和安装程序头结构,以消除对合法软件的误报。--dump 将可疑区段和覆盖层直接提取到磁盘,以便离线去混淆。要求:Windows、Linux 或 macOS 上的 Python 3.8+。
pip install entropystrip
或直接从源码安装:
git clone https://github.com/dwexi/entropystrip.git
cd entropystrip
pip install -e .
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
分析单个二进制文件:
python main.py target.exe
带 MITRE ATT&CK 映射和反汇编的深度取证分类:
python main.py suspicious.exe --deep
分析并提取隐藏的载荷缓冲区:
python main.py suspicious.exe --dump
提取的载荷会写入 extracted_payloads/<target>_<section>.bin。
导出独立的 HTML 报告:
python main.py sample.exe --html report.html
对包含未知文件的整个目录进行分类:
python main.py "C:\IncidentTriage" -r
香农熵以每字节 0.00 到 8.00 比特衡量信息密度:
$$H(X) = -\sum_{i=0}^{255} P(x_i) \log_2 P(x_i)$$
| 熵值范围 | 预期内容 | 说明 |
|---|---|---|
0.00 - 2.00 | 零填充、稀疏表 | 常见于未初始化数据或对齐填充 |
2.00 - 5.50 | 标准 ASCII、配置 | 正常的应用程序元数据、字符串 |
5.50 - 6.60 | 原生编译机器码 | 标准 x86/x64 指令(.text) |
6.60 - 7.30 | 压缩资源 | 位图、图标、zlib/deflate 流 |
7.40 - 8.00 | 加密密文 | AES/RC4 加密载荷或紧密打包的 shellcode |
MIT 许可证。详情请参阅 LICENSE。