abusing-dpapi-for-cred…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using…
Deploys canary files (honeytokens) across file systems to detect ransomware
$ npx -y skills add mukul975/Anthropic-Cybersecurity-Skills --skill deploying-decoy-files-for-ransomware-detection --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/deploying-decoy-files-for-ransomware-detectionContext preview
The summary Claude sees to decide when to auto-load this skill.
Deploys canary files (honeytokens) across file systems to detect ransomware
name: deploying-decoy-files-for-ransomware-detection
description: 'Deploys canary files (honeytokens) across file systems to detect ransomware
encryption activity in real time. Uses strategically placed decoy documents monitored
via file integrity monitoring or OS-level watchdogs to trigger alerts when ransomware
modifies or encrypts them. Activates for requests involving ransomware canary deployment,
honeyfile setup, deception-based ransomware detection, or file integrity monitoring
for encryption.
'
domain: cybersecurity
subdomain: ransomware-defense
tags:
- ransomware
- detection
- canary-files
- honeytokens
- deception
- file-integrity
version: 1.0.0
author: mahipal
license: Apache-2.0
nist_csf:
- PR.DS-11
- RS.MA-01
- RC.RP-01
- PR.IR-01
mitre_attack:
- T1486
- T1083
- T1490
- T1485
mitre_f3:
version: '1.1'
tactics:
- monetization
- positioning
- stealth
techniques:
- id: F1018
name: Convert to Cryptocurrency
tactic: monetization
source: f3
- id: F1017.001
name: 'Conversion to Physical Monetary Instruments: Cash'
tactic: monetization
source: f3
- id: T1219
name: Remote Access Tools
tactic: positioning
source: attack
- id: T1070
name: Indicator Removal
tactic: stealth
source: attack**Do not use** decoy files as the sole ransomware defense. They are a detection mechanism, not a prevention mechanism, and should complement backups, EDR, and access controls.
Plan file placement for maximum detection coverage:
Canary File Placement Strategy: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Naming Convention: - Use names that sort FIRST and LAST alphabetically in each directory - Ransomware typically enumerates directories A-Z or Z-A - Examples: _AAAA_budget_2024.docx, ~zzzz_report_final.xlsx Placement Locations: - Root of every file share (\\server\share\_AAAA_canary.docx) - Desktop, Documents, Downloads on each endpoint - Department-specific shares (Finance, HR, Legal) - Backup staging directories - Home directories of high-privilege accounts File Types: - .docx, .xlsx, .pdf (most targeted by ransomware) - .sql, .bak (database files, high value) - Mix of file types to detect ransomware that targets specific extensions
Create decoy files with realistic content and metadata:
import os
import time
def create_canary_docx(filepath, content="Q4 Financial Summary - Confidential"):
"""Create a realistic .docx canary file using python-docx."""
from docx import Document
doc = Document()
doc.add_heading("Financial Report - CONFIDENTIAL", level=1)
doc.add_paragraph(content)
doc.add_paragraph(f"Generated: {time.strftime('%Y-%m-%d')}")
doc.save(filepath)
def create_canary_txt(filepath):
"""Create a simple text canary with known content for hash verification."""
content = "CANARY_TOKEN_DO_NOT_MODIFY\n"
content += f"Created: {time.strftime('%Y-%m-%dT%H:%M:%S')}\n"
content += "This file is monitored for unauthorized changes.\n"
with open(filepath, "w") as f:
f.write(content)Monitor canary files for any modification, rename, or deletion:
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
class CanaryHandler(FileSystemEventHandler):
def __init__(self, canary_paths, alert_callback):
self.canary_paths = set(canary_paths)
self.alert_callback = alert_callback
def on_modified(self, event):
if event.src_path in self.canary_paths:
self.alert_callback("MODIFIED", event.src_path)
def on_deleted(self, event):
if event.src_path in self.canary_paths:
self.alert_callback("DELETED", event.src_path)
def on_moved(self, event):
if event.src_path in self.canary_paths:
self.alert_callback("RENAMED", event.src_path)Define automated responses when canary files are triggered:
Alert Response Matrix: ━━━━━━━━━━━━━━━━━━━━━ Event: Canary MODIFIED → Severity: CRITICAL → Action: Alert SOC, identify modifying process (PID), isolate endpoint Event: Canary DELETED → Severity: HIGH → Action: Alert SOC, check for ransomware note in same directory Event: Canary RENAMED (new extension added) → Severity: CRITICAL → Action: Alert SOC, check extension against known ransomware extensions → Automated: Kill modifying process, disable network interface Event: Multiple canaries triggered within 60 seconds → Severity: EMERGENCY → Action: Network-wide isolation, activate incident response plan
Test that canary files detect actual ransomware behavior:
# Simulate ransomwa
817 structured cybersecurity skills for AI agents · Mapped to 6 frameworks: MITRE ATT&CK, NIST CSF 2.0, MITRE ATLAS, D3FEND, NIST AI RMF & MITRE F3 (Fight Fraud) · agentskills.io standard · Works with Claude Code, GitHub Copilot, Codex CLI, Cursor, Gemini CLI & 20+ platforms · 29 security domains · Apache 2.0
Repo: mukul975/Anthropic-Cybersecurity-Skills
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using…
Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, or…
Prepare a defense-contractor environment for CMMC Level 2 certification: scope CUI and FCI, implement the 110 NIST SP 800-171 Rev 2 security requirements…
Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification…
Detect dangerous ACL misconfigurations in Active Directory using ldap3
Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection,…