Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Entropy-Spot-The-Malware

See the entropy, spot the malware!

See the Invisible Structure of Any File

Python Version License: MIT Zero Dependencies


EntropyVision is a pure Python, zero-dependency tool that turns any file into a living color map directly in your terminal. No screenshots needed — the magic happens when you run it yourself.

No installations. No external libraries. Just Python and your curiosity.


🎯 Why EntropyVision?

Every file has a hidden fingerprint. A .txt file whispers in predictable patterns. A .jpg screams with randomness. A malware sample hides its chaos behind layers of encryption.

EntropyVision reveals this fingerprint — not with boring numbers, but with a flowing river of color that tells you instantly:

  • Which parts of a file are structured (safe, human-readable).
  • Which parts are random (compressed, encrypted, or suspicious).
  • Whether a file is likely safe or worth a second look.

🔬 The Science Behind It

This tool calculates Shannon Entropy — a mathematical measure of randomness — for every block of data in your file.

$$H = - \sum_{i=0}^{255} p_i \cdot \log_2(p_i)$$

Where p_i is the probability of each byte value (0 to 255) appearing in the block.

· Low Entropy (0–4): Predictable data → Text, structured files, source code. · Medium Entropy (4–6): Mixed data → Binaries, compressed files, some media. · High Entropy (6–8): Random data → Encrypted content, packed executables, malware.

EntropyVision translates these numbers into a live gradient you can see and feel — from calming greens to warning yellows, all the way to alarming reds.


🚀 Getting Started

Prerequisites

· Python 3.6 or higher (no additional packages required)

Installation

git clone https://github.com/Arad883/Entropy-Spot-The-Malware.git

That's it. No pip install. No virtual environment drama.

Usage

python entropy_vision.py <file_path>

Examples:

# Analyze a text file
python entropy_vision.py my_notes.txt

# Analyze a PDF
python entropy_vision.py document.pdf

# Analyze a suspicious executable
python entropy_vision.py sample.exe

🧠 What You'll See (Without Seeing It)

When you run the tool, your terminal transforms into a visual dashboard:

  1. A live color strip flows across your screen — each colored block represents 1 KB of your file.
  2. The gradient tells a story: · 🟩 Green blocks = Safe, structured data (like plain text or JSON). · 🟨 Yellow blocks = Mixed or binary data (like compiled code or ZIP archives). · 🟥 Red blocks = High entropy (encrypted, compressed, or packed).
  3. Real-time numbers appear alongside the colors, showing exact entropy values.
  4. A final verdict summarizes the file's overall risk level: · ✅ Low Risk — Likely plain text or structured data. · ⚠️ Medium Risk — Binary or mixed content. · 🚨 High Risk — Encrypted, compressed, or potentially malicious.

🌟 Why This Matters

In cybersecurity, entropy analysis is a first-line defense. Malware authors often compress or encrypt their code to evade detection. EntropyVision helps you:

· Spot suspicious files at a glance. · Understand file structure without needing a hex editor. · Make informed decisions before running unknown files.

It's not a replacement for deep analysis — but it's the fastest way to know where to look.


🛠️ Future Enhancements

· Directory Mode: Analyze entire folders in one run. · Export Reports: Save heatmaps as HTML for documentation. · Threshold Tuning: Customize the entropy ranges for specific use cases.


🤝 Contributing

This project is open for feedback, ideas, and contributions. If you find a bug, have a suggestion, or just want to say hi — open an issue.


📜 License

MIT License — free for personal and commercial use. See LICENSE for details.


👨‍💻 Author

Arad Cybersecurity Developer | Python & Julia Enthusiast

· GitHub: Arad883


Made with ☕ and a love for pure Python

```