New to Claude Skills? Learn how to install them →

mukul975 on GitHub

Detecting Beaconing Patterns

Free

Analyze Zeek logs to identify command-and-control callbacks.

Get this skill

Free · Opens the source repo

What Detecting Beaconing Patterns does

Detecting Beaconing Patterns with Zeek is a specialized skill designed for security analysts and incident responders who need to identify command-and-control (C2) beaconing activities in network traffic. This skill leverages the ZAT (Zeek Analysis Tools) library to process Zeek's conn.log files, transforming them into Pandas DataFrames for detailed statistical analysis. By calculating inter-arrival times of network connections, the skill can flag periodic connections that exhibit low jitter, which are indicative of potential C2 callbacks.

The process begins by loading the Zeek conn.log data, which contains information about network connections, including timestamps and source/destination IP addresses. The skill groups these connections by their source and destination pairs, enabling focused analysis on specific communication paths. Analysts can then compute the statistical measures necessary to detect beaconing patterns, specifically looking at the standard deviation of inter-arrival times. A low standard deviation relative to the mean indicates a high likelihood of beaconing behavior.

This skill is particularly useful in scenarios where security operations teams are tasked with threat hunting or validating their monitoring capabilities against known attack techniques. It provides a structured approach to analyzing network traffic, making it easier to build detection rules or queries that can be integrated into broader security monitoring frameworks.

In summary, Detecting Beaconing Patterns with Zeek is an essential tool for cybersecurity professionals focused on identifying and mitigating threats posed by C2 communications. It offers a practical solution for those looking to enhance their network security posture through effective log analysis and statistical techniques.

When to use it

Use this skill when analyzing network logs for potential security incidents involving C2 communications, or when developing detection strategies for threat hunting.

When not to use it

This skill may not be suitable for environments where Zeek logs are not available or for users unfamiliar with Python and statistical analysis.

What you can build with it

Investigating Security Incidents

Use this skill to analyze conn.log files when responding to suspected security breaches involving C2 communications.

Building Detection Rules

Leverage the statistical analysis capabilities to create effective detection rules for identifying beaconing activities.

Validating Security Monitoring

Employ this skill to assess the effectiveness of existing security monitoring solutions against known attack patterns.

How to install Detecting Beaconing Patterns

View source

1. Install with the skills CLI

npx skills add mukul975/anthropic-cybersecurity-skills/detecting-beaconing-patterns-with-zeek --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

Detecting Beaconing Patterns with Zeek

When to Use

  • When investigating security incidents that require detecting beaconing patterns with zeek
  • 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

  • Familiarity with security operations concepts and tools
  • Access to a test or lab environment for safe execution
  • Python 3.8+ with required dependencies installed
  • Appropriate authorization for any testing activities

Instructions

Load Zeek conn.log data using ZAT (Zeek Analysis Tools), group connections by source/destination pairs, and compute timing statistics to identify beaconing.

from zat.log_to_dataframe import LogToDataFrame
import numpy as np

log_to_df = LogToDataFrame()
conn_df = log_to_df.create_dataframe('/path/to/conn.log')

# Group by src/dst pair and calculate inter-arrival time
for (src, dst), group in conn_df.groupby(['id.orig_h', 'id.resp_h']):
    times = group['ts'].sort_values()
    intervals = times.diff().dt.total_seconds().dropna()
    if len(intervals) > 10:
        std_dev = np.std(intervals)
        mean_interval = np.mean(intervals)
        # Low std_dev relative to mean = likely beaconing

Key analysis steps:

  1. Parse Zeek conn.log into DataFrame with ZAT LogToDataFrame
  2. Group connections by source IP and destination IP pairs
  3. Calculate inter-arrival time intervals between consecutive connections
  4. Compute standard deviation and coefficient of variation
  5. Flag pairs with low coefficient of variation as potential beacons

Examples

from zat.log_to_dataframe import LogToDataFrame
log_to_df = LogToDataFrame()
df = log_to_df.create_dataframe('conn.log')
print(df[['id.orig_h', 'id.resp_h', 'ts', 'duration']].head())

Frequently asked questions about Detecting Beaconing Patterns

Similar skills