implementing-ransomware-kill-switch-detection

mukul975/Anthropic-Cybersecurity-Skills · updated May 25, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills install mukul975/Anthropic-Cybersecurity-Skills/implementing-ransomware-kill-switch-detection
0 commentsdiscussion
summary

Detects and exploits ransomware kill switch mechanisms including mutex-based execution guards, domain-based kill switches, and registry-based termination checks. Implements proactive mutex vaccination and kill switch domain monitoring to prevent ransomware from executing. Activates for requests involving ransomware kill switch analysis, mutex vaccination, WannaCry-style domain kill switches, or malware execution guard detection.

skill.md
name
implementing-ransomware-kill-switch-detection
description
'Detects and exploits ransomware kill switch mechanisms including mutex-based execution guards, domain-based kill switches, and registry-based termination checks. Implements proactive mutex vaccination and kill switch domain monitoring to prevent ransomware from executing. Activates for requests involving ransomware kill switch analysis, mutex vaccination, WannaCry-style domain kill switches, or malware execution guard detection. '
domain
cybersecurity
subdomain
ransomware-defense
tags
- ransomware - kill-switch - mutex - detection - WannaCry - malware-analysis
version
1.0.0
author
mahipal
license
Apache-2.0
nist_csf
- PR.DS-11 - RS.MA-01 - RC.RP-01 - PR.IR-01

Implementing Ransomware Kill Switch Detection

When to Use

  • Analyzing a ransomware sample to determine if it contains a kill switch mechanism (mutex, domain, registry)
  • Deploying proactive mutex vaccination across endpoints to prevent known ransomware families from executing
  • Monitoring DNS for kill switch domain lookups that indicate ransomware attempting to check before encrypting
  • During incident response to quickly determine if a ransomware variant can be stopped by activating its kill switch
  • Building detection signatures for ransomware mutex creation events using Sysmon or EDR telemetry

Do not use kill switch vaccination as a primary defense. Not all ransomware families implement kill switches, and those that do may remove them in newer versions. This is a supplementary detection and prevention layer.

Prerequisites

  • Python 3.8+ with ctypes (Windows) for mutex creation and enumeration
  • Sysmon installed with Event ID 1 (process creation) and Event ID 17/18 (pipe/mutex events) configured
  • Access to malware analysis sandbox for identifying kill switch mechanisms in samples
  • DNS monitoring capability for detecting kill switch domain resolution attempts
  • Familiarity with Windows internals: mutexes (mutants), kernel objects, named pipes
  • Reference database of known ransomware mutexes (github.com/albertzsigovits/malware-mutex)

Workflow

Step 1: Identify Kill Switch Mechanisms in Ransomware

Analyze samples for common kill switch patterns:

Kill Switch Types Found in Ransomware:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. MUTEX-BASED (most common):
   - Ransomware creates a named mutex at startup
   - If mutex already exists → another instance is running → exit
   - Defense: Pre-create the mutex to prevent execution
   - Examples:
     WannaCry:     Global\MsWinZonesCacheCounterMutexA
     Conti:        kasKDJSAFJauisiudUASIIQWUA82
     REvil:        Global\{GUID-based-on-machine}
     Ryuk:         Global\YOURPRODUCT_MUTEX

2. DOMAIN-BASED:
   - Ransomware resolves a hardcoded domain before executing
   - If domain resolves → security sandbox detected → exit
   - Defense: Register/sinkhole the domain to activate kill switch
   - Examples:
     WannaCry v1:  iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com
     WannaCry v1:  fferfsodp9ifjaposdfjhgosurijfaewrwergwea.com

3. REGISTRY-BASED:
   - Check for specific registry key/value before executing
   - If key exists → exit (anti-analysis or kill switch)
   - Defense: Create the registry key proactively

4. FILE-BASED:
   - Check for existence of specific file or directory
   - If marker file exists → exit
   - Defense: Create the marker file on all endpoints

5. LANGUAGE-BASED:
   - Check system language/keyboard layout
   - Exit if Russian/CIS country keyboard detected
   - Common in Eastern European ransomware groups

Step 2: Deploy Mutex Vaccination

Pre-create known ransomware mutexes on endpoints to prevent execution:

# Windows mutex vaccination using ctypes
import ctypes
from ctypes import wintypes

kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)

def create_mutex(name):
    """Create a named mutex to vaccinate against ransomware."""
    handle = kernel32.CreateMutexW(None, False, name)
    error = ctypes.get_last_error()
    if handle == 0:
        return False, f"Failed to create mutex: error {error}"
    if error == 183:  # ERROR_ALREADY_EXISTS
        return True, f"Mutex already exists (already vaccinated): {name}"
    return True, f"Mutex created successfully: {name}"

KNOWN_RANSOMWARE_MUTEXES = [
    "Global\\MsWinZonesCacheCounterMutexA",        # WannaCry
    "Global\\kasKDJSAFJauisiudUASIIQWUA82",        # Conti
    "Global\\YOURPRODUCT_MUTEX",                     # Ryuk variant
    "Global\\JhbGjhBsSQjz",                         # Maze
    "Global\\sdjfhksjdhfsd",                         # Generic ransomware
]

Step 3: Monitor for Mutex Creation Events

Use Sysmon to detect when ransomware creates its characteristic mutexes:

<!-- Sysmon configuration for mutex monitoring -->
<Sysmon schemaversion="4.90">
  <EventFiltering>
    <!-- Event ID 1: Process creation with mutex indicators -->
    <ProcessCreate onmatch="include">
      <CommandLine condition="contains">mutex</CommandLine>
      <CommandLine condition="contains">CreateMutex</CommandLine>
    </ProcessCreate>
  </EventFiltering>
</Sysmon>
Detection via Event Logs:
━━━━━━━━━━━━━━━━━━━━━━━━
Windows Security Log:
  Event ID 4688: Process creation (enable command line logging)

Sysmon:
  Event ID 1:  Process create (includes command line and hashes)
  Event ID 17: Pipe created (named pipes, similar to mutexes)

PowerShell detection:
  Event ID 4104: Script block logging (detect mutex creation in scripts)

Velociraptor artifact:
  Windows.Detection.Mutants - Enumerates all named mutant objects

Step 4: Monitor DNS for Kill Switch Domains

Detect ransomware domain-based kill switch resolution attempts:

DNS Monitoring for Kill Switch Domains:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. Monitor DNS queries for known kill switch domains
2. High-entropy domain names (>4.0 entropy in domain label) may indicate
   ransomware kill switch domains or DGA-generated C2 domains
3. Queries to newly registered domains from endpoints that typically
   only access well-established domains

Indicators:
  - Domain with no prior resolution history
  - Domain registered in last 24-72 hours
  - High character entropy in domain name
  - Resolution attempt followed by either mass encryption (kill switch failed)
    or process termination (kill switch activated)

Step 5: Enumerate Active Mutexes for Incident Response

During an active incident, scan endpoints for ransomware-associated mutexes:

# PowerShell: List all named mutant objects using Sysinternals Handle
# handle.exe -a -p <PID> | findstr "Mutant"

# Velociraptor query for mutex hunting:
# SELECT * FROM glob(globs="\\BaseNamedObjects\\*") WHERE Name =~ "mutex_pattern"

# Python-based enumeration (requires pywin32):
# import win32event
# handle = win32event.OpenMutex(0x00100000, False, "Global\\MutexName")

Verification

  • Verify mutex vaccination by attempting to create the same mutex (should get ERROR_ALREADY_EXISTS)
  • Test that vaccinated mutexes survive system reboot (they do not; re-apply at startup via scheduled task)
  • Confirm DNS monitoring detects test queries for known kill switch domains
  • Validate Sysmon event generation for mutex creation by running a test script
  • Check that vaccination does not interfere with legitimate applications using similar mutex names
  • Test against actual ransomware samples in an isolated sandbox to confirm kill switch activation

Key Concepts

TermDefinition
Mutex (Mutant)A Windows kernel synchronization object used to ensure only one instance of a program runs; ransomware uses named mutexes to prevent re-infection
Kill SwitchA mechanism in ransomware that causes it to terminate without encrypting if a specific condition is met (mutex exists, domain resolves, file present)
Mutex VaccinationProactively creating named mutexes on endpoints that match known ransomware mutex names, preventing the ransomware from executing
Domain SinkholeRegistering or redirecting a malicious domain to a controlled server; used to activate domain-based kill switches
DGA (Domain Generation Algorithm)Algorithm used by malware to generate pseudo-random domain names for C2 communication, sometimes incorporating kill switch checks

Tools & Systems

  • Sysmon: Microsoft system monitor providing Event ID 17/18 for named pipe and mutex creation monitoring
  • Velociraptor: Endpoint visibility tool with built-in artifacts for enumerating mutant (mutex) objects on Windows
  • Sysinternals Handle: Command-line tool for listing open handles including named mutexes per process
  • malware-mutex (GitHub): Community-maintained database of mutexes used by known malware families
  • ANY.RUN: Interactive malware sandbox that reports mutex creation during dynamic analysis
  • PassiveDNS: DNS monitoring infrastructure for detecting kill switch domain resolution attempts
how to use implementing-ransomware-kill-switch-detection

How to use implementing-ransomware-kill-switch-detection on Cursor

AI-first code editor with Composer

1

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 implementing-ransomware-kill-switch-detection
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills install mukul975/Anthropic-Cybersecurity-Skills/implementing-ransomware-kill-switch-detection

The skills CLI fetches implementing-ransomware-kill-switch-detection from GitHub repository mukul975/Anthropic-Cybersecurity-Skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/implementing-ransomware-kill-switch-detection

Reload or restart Cursor to activate implementing-ransomware-kill-switch-detection. Access the skill through slash commands (e.g., /implementing-ransomware-kill-switch-detection) 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

GET_STARTED →

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. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 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

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.832 reviews
  • Pratham Ware· Dec 16, 2024

    Solid pick for teams standardizing on skills: implementing-ransomware-kill-switch-detection is focused, and the summary matches what you get after install.

  • Sofia Gill· Dec 4, 2024

    implementing-ransomware-kill-switch-detection reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Ren Smith· Nov 23, 2024

    We added implementing-ransomware-kill-switch-detection from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Anika Kim· Oct 14, 2024

    implementing-ransomware-kill-switch-detection fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Sakura Verma· Sep 21, 2024

    implementing-ransomware-kill-switch-detection is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Sakshi Patil· Sep 5, 2024

    I recommend implementing-ransomware-kill-switch-detection for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Valentina Iyer· Sep 5, 2024

    Keeps context tight: implementing-ransomware-kill-switch-detection is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Chaitanya Patil· Aug 24, 2024

    Useful defaults in implementing-ransomware-kill-switch-detection — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Aanya Anderson· Aug 24, 2024

    implementing-ransomware-kill-switch-detection is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Kiara Abebe· Aug 12, 2024

    Keeps context tight: implementing-ransomware-kill-switch-detection is the kind of skill you can hand to a new teammate without a long onboarding doc.

showing 1-10 of 32

1 / 4