New to Claude Skills? Learn how to install them →

mukul975 on GitHub

Hunting for Registry Run Key Persistence

Free

Detect malicious registry persistence mechanisms in Windows.

Get this skill

Free · Opens the source repo

What Hunting for Registry Run Key Persistence does

The Hunting for Registry Run Key Persistence skill is designed for security professionals focused on identifying and mitigating threats related to Windows registry persistence mechanisms. By leveraging Sysmon Event ID 13 logs, this skill enables users to analyze registry modifications that may indicate malicious activity. The skill specifically targets Run keys, which are commonly exploited by attackers to ensure their programs execute automatically upon user login. By monitoring these keys, analysts can detect unauthorized modifications that may signify an active threat.

This skill provides a structured approach to threat hunting, allowing security operations center (SOC) analysts to build detection rules and queries tailored to registry persistence techniques. It is particularly useful when investigating security incidents or validating the effectiveness of existing security monitoring coverage. Users will benefit from a comprehensive procedure that includes collecting relevant logs, parsing event data, and flagging suspicious entries based on known indicators of compromise.

The skill also emphasizes the importance of contextual analysis by comparing flagged entries against a baseline of legitimate auto-start programs. This helps analysts discern between benign and malicious modifications. Additionally, by chaining Sysmon events, users can confirm the creation and execution of suspicious binaries, further enhancing their detection capabilities. The expected output is a detailed JSON report that summarizes findings and provides recommended detection rules, complete with MITRE ATT&CK mappings to facilitate understanding and response.

Designed for security analysts, incident responders, and threat hunters, this skill is an essential tool for anyone tasked with maintaining the integrity of Windows environments against persistence threats. It requires a foundational understanding of Sysmon logs and a familiarity with legitimate auto-start programs to effectively utilize its capabilities.

When to use it

Use this skill when investigating potential security incidents or when building detection capabilities for registry persistence.

When not to use it

This skill may not be suitable for environments without Sysmon installed or for those unfamiliar with Windows registry operations.

What you can build with it

Incident Investigation

Use this skill to analyze Sysmon logs during a security incident to identify unauthorized registry modifications.

Building Detection Rules

Leverage the skill to create tailored detection rules for monitoring registry persistence techniques in your environment.

Validating Security Coverage

Employ this skill to assess whether your existing security monitoring effectively covers registry persistence threats.

How to install Hunting for Registry Run Key Persistence

View source

1. Install with the skills CLI

npx skills add mukul975/anthropic-cybersecurity-skills/hunting-for-registry-run-key-persistence --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by mukul975

Hunting for Registry Run Key Persistence

Overview

Registry Run keys (T1547.001) are one of the most commonly used persistence mechanisms by adversaries. When a program is added to a Run key in the Windows registry, it executes automatically when a user logs in. Attackers abuse keys under HKLM\Software\Microsoft\Windows\CurrentVersion\Run, HKCU\Software\Microsoft\Windows\CurrentVersion\Run, and their RunOnce counterparts to maintain persistence. Sysmon Event ID 13 (RegistryEvent - Value Set) captures registry value modifications including the target object path, the process that made the change, and the new value. Detection involves monitoring these events for suspicious executables in temp directories, encoded PowerShell commands, LOLBin paths, and processes that do not normally create Run key entries. Chaining Event 13 with Event 1 (Process Creation) and Event 11 (FileCreate) strengthens detection by confirming payload creation and execution.

When to Use

  • When investigating security incidents that require hunting for registry run key persistence
  • When building detection rules or threat hunting queries for this domain
  • When SOC analysts need structured procedures for this analysis type
  • When validating security monitoring coverage for related attack techniques

Prerequisites

  • Windows systems with Sysmon installed and configured to log Event ID 13
  • Sysmon config with RegistryEvent rules for Run/RunOnce keys
  • Python 3.9+ with json, xml.etree.ElementTree, re modules
  • SIEM or log aggregator collecting Sysmon logs (Splunk, Elastic, Sentinel)
  • Knowledge of legitimate auto-start programs for baseline comparison

Steps

  1. Collect Sysmon Event ID 13 logs filtered for Run/RunOnce key paths
  2. Parse event XML/JSON for TargetObject, Details (value written), Image (modifying process)
  3. Flag entries where the value points to temp directories, AppData, or ProgramData
  4. Detect encoded PowerShell commands or script interpreters in registry values
  5. Identify LOLBin abuse (mshta.exe, rundll32.exe, regsvr32.exe, wscript.exe)
  6. Compare against known-good baseline of legitimate auto-start entries
  7. Check if the modifying process (Image) is unusual (cmd.exe, powershell.exe, python.exe)
  8. Chain with Event ID 1 to verify if the registered binary was recently created
  9. Generate detection report with MITRE ATT&CK mapping and severity scores
  10. Produce Sigma/Splunk detection rules from findings

Expected Output

A JSON report listing suspicious Run key entries with the registry path, value written, modifying process, timestamp, MITRE technique mapping, severity rating, and recommended Sigma detection rules.

Frequently asked questions about Hunting for Registry Run Key Persistence

Similar skills