mcpField
D
detecting-beaconing-patterns-with-zeek

detecting-beaconing-patterns-with-zeek

github.com/mukul975Security35.2k44 installsUpdated 8w ago
Repository

About detecting-beaconing-patterns-with-zeek

A security-analysis skill for SOC analysts and threat hunters using Zeek connection logs. It applies timing statistics to source-destination connection pairs to flag potential beaconing activity.

Key features

  1. 01Parse Zeek conn.log with ZAT
  2. 02Group connections by IP pair
  3. 03Calculate connection intervals
  4. 04Flag low-variation timing patterns

Use cases

  1. 01Investigating suspected beaconing
  2. 02Building detection rules or hunts
  3. 03Checking monitoring coverage

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/mukul975/anthropic-cybersecurity-skills --skill detecting-beaconing-patterns-with-zeek

After installing, type/detecting-beaconing-patterns-with-zeekin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

LICENSE
references/
api-reference.md
scripts/
agent.py

Details

From the project README

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())

Comments

Markdown supported