measuring-section-entropy-to-detect-packing
Detects packing and encryption by measuring Shannon entropy across a binary''s
v1.0.03 installs+3 in 7 days24 StarsApache-2.0synced 10 hours ago
Install
No NotHoly CLI yet? Install it first.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install meltedinhex/measuring-section-entropy-to-detect-packingWrites to ~/.notholy/skills after checking the signature and the SHA-256.
SignatureSigned, ed25519
Packaged10f79fa…5e39fede
d10f79fa3e24…6d0b5e39fede4 files · 3.4 KBScanMedium2 findings
- Executable script shipped with the skillscripts/analyst.py
- Links to outside domains
Sourcegithub.com/meltedinhex/analyst-ai-pack/tree/main/skills/measuring-section-entropy-to-detect-packing@da7600a
On this page
When to Use
- You want a quick statistical signal of whether a sample is packed or encrypted.
- You are triaging a PE and need to flag suspicious high-entropy executable sections.
- You are deciding whether to route a sample to an unpacking workflow.
Do not use entropy as a verdict — legitimate compressed resources and installers also show high entropy; combine with imports, section names, and raw/virtual size anomalies.
Prerequisites
- Python (
mathstdlib); optionallypefilefor per-section analysis.
Safety & Handling
- Compute entropy on the inert file; never execute the sample.
- Keep the sample password-protected at rest and reference it by hash.
Workflow
Step 1: Compute whole-file and sliding-window entropy
Calculate Shannon entropy (0–8 bits/byte). Sliding-window entropy reveals localized high-entropy regions even when the overall value is moderate.
python scripts/analyst.py entropy sample.exeStep 2: Compute per-section entropy (PE)
For each PE section, compute entropy and compare raw vs. virtual size. Executable sections with entropy > ~7.0 are a packing indicator.
Step 3: Correlate structural anomalies
Flag classic packer signs: high-entropy .text, unusual/renamed sections (UPX0, random
names), tiny raw size but large virtual size, and an entry point outside .text.
Step 4: Decide routing
If indicators stack (high entropy + thin IAT + odd sections), route to unpacking; otherwise proceed with normal static analysis.
Validation
- High-entropy executable sections are corroborated by other packing signs before concluding.
- Benign high-entropy cases (compressed resources) are not misclassified as packers.
- The routing decision (unpack vs. proceed) is justified by combined indicators.
Pitfalls
- Calling any high-entropy file "packed" without structural corroboration.
- Ignoring sliding-window entropy and missing a localized encrypted blob.
- Overlooking raw-vs-virtual size mismatch, a strong unpacking-at-runtime hint.
References
- See
references/api-reference.mdfor the entropy tool. - Shannon entropy and the PE/COFF spec (linked in frontmatter).
Files in this version
references/11.3 KB
- api-reference.md1.3 KB
scripts/13.0 KB
- analyst.py3.0 KB
- LICENSE340 B
- SKILL.md3.1 KB
Permissions
| Permission | Declared | Found by the scan |
|---|---|---|
| Reads files | No | No |
| Writes files | Yes | Yes |
| Runs shell commands | Yes | Yes |
| Uses the network | Yes | Yes |
| Uses connectors | No | No |
| Drives a browser | No | No |
Scan findings
Reviewed on Nov 13, 2026
- MediumFile · Executable script shipped with the skillscripts/analyst.py
- InfoLink · Links to outside domains
A clean scan lowers the risk but does not prove a package is safe. Read what you install.
| Version | Published | Commit | SHA-256 | Signature | Permission change |
|---|---|---|---|---|---|
| v1.0.0 | Nov 13, 2026 | da7600a | d10f79fa | Signed | – |
More from meltedinhex
All from this publisher- writing-yara-rules-from-reversed-codemeltedinhex/writing-yara-rules-from-reversed-code4
- validating-detections-with-atomic-testsmeltedinhex/validating-detections-with-atomic-tests4
- writing-suricata-and-snort-rulesmeltedinhex/writing-suricata-and-snort-rules3
- writing-sigma-detection-rulesmeltedinhex/writing-sigma-detection-rules3
More in Reverse engineering and fuzzing
See the categoryAsk anything your scope allows.
Create an account, add credits and ask the first question in the chat or the terminal.
- 1/3
Create the account
Individual or company. You can switch to a company later without losing balance or keys.
IndividualCompany - 2/3
Add credits
By card. Pay per token, no subscription.
$5.00minimum deposit - 3/3
Ask
In the chat, or install the CLI and run notholy login in your terminal.
$ notholy login