मुख्य सामग्री पर जाएँ
Skillpedia
एजेंट35k · #7865

detecting-ransomware-encryption-behavior

यह क्या करती है

यह सिस्टम रियल-टाइम में पता लगाता है कि कहीं ransomware आपकी फ़ाइलों को encrypt तो नहीं कर रहा। यह देखता है कि फ़ाइलें कैसे बदल रही हैं, और अगर उनका content बहुत ज़्यादा random (high entropy) हो जाए, जो encryption की निशानी है, तो उस पर नज़र रखता है।

कब इस्तेमाल करें

  • ✓नए तरह के ransomware को पकड़ने वाला सिस्टम बनाते समय।
  • ✓file servers और computers को बड़े पैमाने पर encryption से बचाने के लिए monitoring करते समय।
  • ✓किसी प्रोग्राम की संदिग्ध गतिविधि की जाँच करते समय, जैसे जब वह तेज़ी से बहुत सारी फ़ाइलें encrypt कर रहा हो।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-ransomware-encryption-behavior/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“रियल-टाइम में ransomware encryption की गतिविधि जाँचो।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

यह फ़ाइल के content की 'randomness' (entropy) का विश्लेषण करता है और देखता है कि प्रोग्राम फ़ाइलों को कैसे access और modify करते हैं। अगर कोई प्रोग्राम तेज़ी से बहुत सारी फ़ाइलें बदलने लगे और उनका content बहुत random हो जाए, तो सिस्टम encryption की संभावना के बारे में alert देता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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

…
अक्सर पूछे जाने वाले सवाल

'entropy' क्या है?

Entropy बताती है कि किसी फ़ाइल का content कितना random या अनुमान से बाहर है। सामान्य फ़ाइलों की entropy अनुमानित रहती है, जबकि encrypt या compress की गई फ़ाइलों की entropy ज़्यादा होती है और वे ज़्यादा random दिखती हैं।

सिर्फ entropy analysis क्यों न इस्तेमाल करें?

Compress की गई फ़ाइलें (जैसे ZIP या JPEG) भी ज़्यादा entropy दिखाती हैं और इससे गलत alarm आ सकते हैं। इसलिए entropy analysis को दूसरे संकेतों के साथ जोड़ना ज़रूरी है, जैसे फ़ाइल बदलने की रफ़्तार और फ़ाइलों का नाम बदलने का पैटर्न।

इसे इस्तेमाल करने के लिए क्या-क्या चाहिए?

Python वाला environment, कुछ libraries (watchdog, psutil), सिस्टम पर नज़र रखने के लिए administrator access, और अपने OS के हिसाब से Sysmon (Windows) या auditd (Linux) जैसे टूल।

जानकारी

लेखक का मूल विवरण

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

लोकप्रियता

GitHub स्टार
35k
रैंकिंग में स्थान
#7865
लाइसेंस
Apache-2.0
अपडेट की गई
31/8/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills