Skip to content

Real-time ransomware anomaly detector for text files - entropy, ASCII ratio, fuzzy similarity, bulk-change heuristics.

License

Notifications You must be signed in to change notification settings

Raz99/Ransomware-Detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ransomware Detection Tool

Overview

This Python-based tool is designed to detect ransomware activity on text files (.txt) in a monitored directory, using a combination of real-time file monitoring, statistical content analysis, fuzzy hashing, and behavioral pattern detection. It aims to identify suspicious modifications such as encryption or mass file changes while minimizing false positives in normal user environments.

Installation

It is recommended to use a virtual environment.

python -m venv .venv && source .venv/bin/activate   # On Windows: .venv\Scripts\activate
pip install -r requirements.txt

Usage

python ransomware_detector.py

You can edit the MONITORED_DIR variable in the script to set the desired path.

Features

  • Real-time monitoring using Watchdog (inotify/FileSystemWatcher) for low-latency detection.
  • Entropy and ASCII ratio analysis to detect statistical anomalies in file content.
  • Fuzzy similarity comparison between old and new versions to detect non-legitimate changes.
  • MIME type detection to identify format changes from text to binary.
  • Behavioral heuristics for bulk modification/deletion events.
  • Honeypot files to catch ransomware early with minimal overhead.

Detection Methods

The tool uses a multi-layered detection approach that includes:

  • Real-Time File Monitoring
    Monitors filesystem events (creation, modification, deletion, rename) using Watchdog for immediate response without constant polling.

  • File Type & Entropy Check
    Identifies anomalies by measuring entropy (randomness) in file content and checking for MIME type changes that indicate encryption.

  • Fuzzy Similarity Analysis
    Compares modified files to their previous versions to detect significant content changes. Low similarity may indicate encryption.

  • Bulk Modification Tracking
    Detects abnormal activity patterns by tracking multiple file changes or deletions in short time windows, which may signal a ransomware outbreak.

  • Honeypot File Detection
    Deploys hidden decoy files that, if accessed or altered, trigger an immediate alert—useful for early-stage ransomware detection.

Sources

We combined detection methods from several academic and technical sources:

Authors

  • Raz Cohen
  • Aliza Lazar

Notes

  • Designed for .txt files with ASCII content.
  • Partial file analysis (~4KB) ensures low I/O and memory overhead.
  • Best used on folders containing non-binary textual workspaces.

About

Real-time ransomware anomaly detector for text files - entropy, ASCII ratio, fuzzy similarity, bulk-change heuristics.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages