Zum Inhalt springen
Skillpedia
Agenten35k · #7865

detecting-ransomware-encryption-behavior

Was er macht

Dieses System erkennt in Echtzeit, ob Ransomware deine Dateien verschlüsselt. Es beobachtet, wie Dateien verändert werden, und ob ihr Inhalt sehr zufällig wird (hohe Entropie), was ein Zeichen für Verschlüsselung ist.

Wann du ihn nutzt

  • ✓Wenn du ein System baust, das neue Arten von Ransomware erkennen soll.
  • ✓Wenn du Dateiserver und Computer gegen massenhafte Verschlüsselung überwachst.
  • ✓Wenn du untersuchst, ob ein Programm verdächtig handelt, etwa weil es viele Dateien schnell verschlüsselt.

Link zum Skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-ransomware-encryption-behavior/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-ransomware-encryption-behavior/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Prüfe in Echtzeit, ob Ransomware gerade Dateien verschlüsselt.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Es analysiert die „Zufälligkeit“ des Dateiinhalts (Entropie) und überwacht, wie Programme auf Dateien zugreifen und sie verändern. Wenn ein Programm anfängt, viele Dateien schnell zu verändern und deren Inhalt sehr zufällig wird, schlägt das System wegen möglicher Verschlüsselung Alarm.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Detecting Ransomware Encryption Behavior

When to Use

  • Building or tuning a behavioral detection layer for ransomware that catches unknown/zero-day variants
  • Monitoring file servers and endpoints for mass encryption activity that evades signature-based detection
  • Implementing entropy-based detection to identify when files are being replaced with encrypted (high-entropy) content
  • Analyzing suspicious process behavior patterns: rapid sequential file opens, writes, renames, and deletes
  • Validating EDR detection rules against actual ransomware encryption patterns during red team exercises

Do not use entropy analysis alone as the only detection signal. Compressed files (ZIP, JPEG, MP4) naturally have high entropy and will cause false positives. Always combine entropy with behavioral signals like I/O rate and file rename patterns.

Prerequisites

  • Python 3.8+ with watchdog and psutil libraries
  • Administrative access for process monitoring and file system event capture
  • Understanding of Shannon entropy and its application to file content analysis
  • Windows: Sysmon installed for detailed process and file system event logging
  • Linux: auditd configured for file access monitoring, or inotify-based watchers
  • Baseline entropy values for common file types in the monitored environment

Workflow

Step 1: Establish Entropy Baselines

Calculate normal entropy ranges for files in the environment:

Entropy Baselines by File Type:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
File Type       Normal Entropy    Encrypted Entropy
.docx           3.5 - 6.5        7.8 - 8.0
.xlsx           4.0 - 6.8        7.8 - 8.0
.pdf            5.0 - 7.2        7.8 - 8.0
.txt            2.0 - 5.0        7.8 - 8.0
.csv            2.0 - 5.5        7.8 - 8.0
.sql            2.5 - 5.0        7.8 - 8.0
.jpg/.png       7.0 - 7.9        7.9 - 8.0 (hard to distinguish)
.zip/.7z        7.5 - 8.0        7.9 - 8.0 (hard to distinguish)

Key insight: Text-based files show the largest entropy jump when encrypted,
making them the best candidates for entropy-based detection.

Step 2: Implement Real-Time Entropy Monitoring

Monitor file writes and calculate entropy of new content:

import math
from collections import Counter

def shannon_entropy(data):
    """Calculate Shannon entropy of byte data (0.0 to 8.0 scale)."""
    if not data:
        return 0.0
    freq = Counter(data)
    length = len(data)
    return -sum((c / length) * math.log2(c / length) for c in freq.values())

def is_encryption_entropy(data, threshold=7.5):
    """Check if data entropy indicates encryption."""
    entropy = shannon_entropy(data)
    return entropy >= threshold, entropy

Step 3: Monitor File System I/O Patterns

Track process-level file operations for ransomware patterns:

Ransomware I/O Behavior Signatures:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. Rapid sequential file modification:
   - >20 files modified per minute by single process
   - Read original → Write encrypted → Rename with new extension
   - Pattern: CreateFile → ReadFile → WriteFile → CloseHandle → MoveFile

2. File extension changes:
   - Original: report.docx → Encrypted: report.docx.locked
   - Many extensions changed within short time window

3. Ransom note creation:
   - Same text file (README.txt, DECRYPT.html) created in multiple directories
   - Created immediately after file encryption in each directory

4. Shadow copy deletion:
   - vssadmin.exe delete shadows /all /quiet
   - wmic.exe shadowcopy delete
   - PowerShell: Get-WmiObject Win32_Shadowcopy | Remove-WmiObject

5. Entropy spike pattern:
   - File read: entropy 3.5 (normal document)
   - File write: entropy 7.9 (encrypted content)
   - Delta > 3.0 is strong ransomware indicator

Step 4: Implement Behavioral Scoring

Combine multiple signals into a composite ransomware score:

def calculate_ransomware_score(process_metrics):
    """Score process behavior for ransomware likelihood (0-100)."""
    score = 0

    # High file modification rate
    files_per_min = process_metrics.get("files_modified_per_minute", 0)
    if files_per_min > 50:
        score += 30
    elif files_per_min > 20:
        score += 15

    # Entropy increase in written files
    avg_entropy_delta = process_metrics.get("avg_entropy_delta", 0)
    if avg_entropy_delta > 3.0:
        score += 30
    elif avg_entropy_delta > 2.0:
        score += 15

    # File extension changes

…
Häufige Fragen

Was ist „Entropie“?

Entropie misst, wie zufällig oder unvorhersehbar der Inhalt einer Datei ist. Normale Dateien haben eine vorhersagbare Entropie, während verschlüsselte oder komprimierte Dateien eine hohe Entropie haben und zufälliger wirken.

Warum reicht nur die Entropie-Analyse nicht aus?

Komprimierte Dateien (etwa ZIP oder JPEG) haben ebenfalls eine hohe Entropie und können Fehlalarme auslösen. Deshalb ist es wichtig, die Entropie-Analyse mit weiteren Signalen zu kombinieren, etwa der Geschwindigkeit von Dateiänderungen und Mustern beim Umbenennen.

Was brauche ich, um das zu nutzen?

Du brauchst eine Umgebung mit Python, bestimmte Bibliotheken (watchdog, psutil), Administratorzugriff, um das System zu überwachen, und je nach Betriebssystem Tools wie Sysmon (Windows) oder auditd (Linux).

Details

Originalbeschreibung des Autors

Detects ransomware encryption activity in real time using entropy analysis, file system I/O monitoring (Sysmon, watchdog, psutil), and behavioral scoring to identify mass file modification, abnormal entropy spikes in written data, and suspicious process behavior characteristic of encryption routines. Use when building real-time ransomware detection, tuning entropy thresholds, or investigating susp

repo: mukul975/Anthropic-Cybersecurity-Skills

Beliebtheit

GitHub-Sterne
35k
Platz im Ranking
#7865
Lizenz
Apache-2.0
Aktualisiert
31.8.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills