An advanced File Integrity Monitoring (FIM) tool integrated with Discord Alerts and Ransomware Heuristics to detect unauthorized file modifications in real-time.
PyFIM Sentinel is a lightweight, agent-less security tool designed to monitor sensitive directories for unauthorized changes. It utilizes SHA-256 hashing to create a baseline of file integrity and continuously verifies current file states against this baseline.
It includes a Heuristic Analysis Engine that detects rapid mass-file modifications—a behavioral pattern typical of Ransomware attacks—and triggers critical alerts immediately via Discord.
- Real-Time Monitoring: Detects file creation, modification, and deletion events instantly.
- 🚨 Ransomware Detection: Heuristic algorithms identify rapid file encryption/deletion (e.g., >5 files in 10s).
- Discord Integration: Sends real-time alerts to a SOC channel via Webhooks.
- Forensic Logging: Maintains a local audit trail (
fim_log.txt) with timestamps. - Visual Console: Color-coded terminal output for easy status monitoring.
- Clone the Repository:
git clone [https://github.com/YourUsername/PyFIM-Sentinel.git](https://github.com/YourUsername/PyFIM-Sentinel.git) cd PyFIM-Sentinel
2. **Install Dependencies:**
```bash
pip install -r requirements.txt
(Or simply run pip install requests)
Before running the tool, open fim.py in any text editor and update the following:
Find the variable TARGET_FOLDER and paste the path of the folder you want to protect.
TARGET_FOLDER = r"D:\Projects\Critical_Data"To get alerts on your phone/PC, you need a Webhook URL:
- Create a personal Discord Server (it's free).
- Go to Server Settings -> Integrations -> Webhooks.
- Click New Webhook, give it a name, and click Copy Webhook URL.
- Paste it into the script:
WEBHOOK_URL = "[https://discord.com/api/webhooks/YOUR_KEY_HERE](https://discord.com/api/webhooks/YOUR_KEY_HERE)"Run the script using Python:
python fim.py
- [1] Initialize Baseline: Calculates hashes for all files in the target directory and saves them to
baseline.json. Run this first or whenever you make authorized changes. - [2] Start Monitoring: Begins the continuous monitoring loop. Keep this terminal window open to view live alerts.
Above: The tool detecting a ransomware simulation (rapid file deletion).
This tool is developed for educational and defensive purposes only. It is designed to demonstrate the principles of File Integrity Monitoring and behavioral analysis.
Created by Satyam Krishna