detecting-ransomware-encryption-behavior▌
mukul975/Anthropic-Cybersecurity-Skills · updated May 25, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
Detects ransomware encryption activity in real time using entropy analysis, file system I/O monitoring, and behavioral heuristics. Identifies mass file modification patterns, abnormal entropy spikes in written data, and suspicious process behavior characteristic of ransomware encryption routines. Activates for requests involving ransomware behavioral detection, entropy-based file monitoring, I/O anomaly detection, or real-time encryption activity alerting.
| name | detecting-ransomware-encryption-behavior |
| description | 'Detects ransomware encryption activity in real time using entropy analysis, file system I/O monitoring, and behavioral heuristics. Identifies mass file modification patterns, abnormal entropy spikes in written data, and suspicious process behavior characteristic of ransomware encryption routines. Activates for requests involving ransomware behavioral detection, entropy-based file monitoring, I/O anomaly detection, or real-time encryption activity alerting. ' |
| domain | cybersecurity |
| subdomain | ransomware-defense |
| tags | - ransomware - detection - entropy - behavioral-analysis - file-monitoring - heuristics |
| version | 1.0.0 |
| author | mahipal |
| license | Apache-2.0 |
| nist_csf | - PR.DS-11 - RS.MA-01 - RC.RP-01 - PR.IR-01 |
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
watchdogandpsutillibraries - 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
extension_changes = process_metrics.get("extension_changes", 0)
if extension_changes > 10:
score += 20
elif extension_changes > 3:
score += 10
# Ransom note creation
if process_metrics.get("ransom_note_created", False):
score += 20
return min(score, 100)
Step 5: Configure Automated Response Thresholds
Set detection thresholds and automated containment actions:
Detection Thresholds:
━━━━━━━━━━━━━━━━━━━━
Score 0-25: INFORMATIONAL - Log only, no action
Score 25-50: LOW - Alert SOC for investigation
Score 50-75: HIGH - Alert SOC, suspend process, snapshot VM
Score 75-100: CRITICAL - Kill process, isolate endpoint, alert IR team
Automated Response Actions:
- Suspend/kill the encrypting process
- Disable network adapter to prevent lateral movement
- Create volume shadow copy snapshot before further damage
- Capture process memory dump for forensic analysis
- Send SIEM alert with process details, affected files, and timeline
Verification
- Test detection against known ransomware samples in an isolated sandbox environment
- Verify that entropy monitoring correctly identifies encrypted vs. compressed files
- Confirm that behavioral scoring produces low false-positive rates on normal workloads
- Validate automated response actions execute within acceptable time (under 5 seconds)
- Test with multiple ransomware families (LockBit, BlackCat, Conti) to verify coverage
- Benchmark monitoring overhead to ensure it does not degrade endpoint performance
Key Concepts
| Term | Definition |
|---|---|
| Shannon Entropy | Mathematical measure of randomness in data (0-8 for bytes); encrypted data approaches 8.0, while text files are typically 2-5 |
| Differential Entropy | The change in entropy between a file's original and modified content; a spike indicates encryption |
| I/O Rate Anomaly | Abnormally high rate of file read/write operations by a single process, characteristic of bulk encryption |
| Behavioral Scoring | Combining multiple weak signals (entropy, I/O rate, file renames) into a composite confidence score |
| Entropy Evasion | Techniques used by advanced ransomware to defeat entropy detection, such as Base64 encoding output or partial encryption |
Tools & Systems
- Sysmon: Windows system monitor providing detailed file system and process events for behavioral analysis
- watchdog (Python): Cross-platform file system monitoring library for real-time file change detection
- psutil (Python): Process and system monitoring library for tracking per-process I/O statistics
- Elastic Endpoint: Commercial endpoint protection with built-in ransomware behavioral detection using canary files
- Wazuh: Open-source security platform with file integrity monitoring and active response capabilities
How to use detecting-ransomware-encryption-behavior on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add detecting-ransomware-encryption-behavior
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches detecting-ransomware-encryption-behavior from GitHub repository mukul975/Anthropic-Cybersecurity-Skills and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate detecting-ransomware-encryption-behavior. Access the skill through slash commands (e.g., /detecting-ransomware-encryption-behavior) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
Task Automation & Efficiency
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Knowledge Enhancement
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Quality Improvement
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Installation Steps
- 1.Install skill using provided installation command
- 2.Test with simple use case relevant to your work
- 3.Evaluate output quality and relevance
- 4.Iterate on prompts to improve results
- 5.Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices▌
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This▌
✓ Use When
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid When
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path▌
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.7★★★★★49 reviews- ★★★★★Ishan Chen· Dec 28, 2024
Keeps context tight: detecting-ransomware-encryption-behavior is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Ishan Yang· Dec 16, 2024
detecting-ransomware-encryption-behavior has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Ama Sethi· Dec 12, 2024
detecting-ransomware-encryption-behavior is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Ishan Liu· Dec 12, 2024
We added detecting-ransomware-encryption-behavior from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Kiara Gupta· Dec 8, 2024
detecting-ransomware-encryption-behavior fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Hana Wang· Nov 27, 2024
detecting-ransomware-encryption-behavior has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Maya Martinez· Nov 7, 2024
detecting-ransomware-encryption-behavior fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Carlos Mensah· Nov 3, 2024
Solid pick for teams standardizing on skills: detecting-ransomware-encryption-behavior is focused, and the summary matches what you get after install.
- ★★★★★Kwame Flores· Oct 26, 2024
We added detecting-ransomware-encryption-behavior from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Mia Zhang· Oct 22, 2024
detecting-ransomware-encryption-behavior has been reliable in day-to-day use. Documentation quality is above average for community skills.
showing 1-10 of 49