Skip to content

meltedinhex/analyst-ai-pack / skills/hunting-c2-beaconing-with-frequency-analysis

hunting-c2-beaconing-with-frequency-analysis

Verified

Detects command-and-control beacons in network logs by analyzing connection timing: measuring inter-arrival intervals, accounting for jitter, and scoring regularity per source/destination pair to surface periodic callbacks. Activates for requests to hunt C2 beaconing, find periodic callbacks, or analyze connection-interval regularity.

FileKindSize
LICENSEother340 B
SKILL.mdskill md3.2 KB
references/api-reference.mdmarkdown1.4 KB
scripts/analyst.pyscript2.7 KB

references/api-reference.md

View on GitHub
# API Reference: Hunting C2 Beaconing with Frequency Analysis

## Overview

`scripts/analyst.py` groups connection logs by source/destination pair, computes inter-arrival
intervals, and scores beacon regularity via the coefficient of variation (jitter tolerant),
optionally boosting on consistent payload sizes. It reads local JSON only and makes no network
connections.

## Dependencies

| Package | Version | Purpose |
|---------|---------|---------|
| (stdlib) | — | statistics, JSON, file IO |

## Input format

```json
[
  {"src": "10.0.0.5", "dst": "evil.example.com", "ts": 1700000000, "bytes": 512},
  {"src": "10.0.0.5", "dst": "evil.example.com", "ts": 1700000060, "bytes": 512}
]
```

## Core functions

### `hunt(conns, min_events)`
Groups by pair, requires `min_events`, scores each, returns candidates with score >= 60.

### `_score_pair(timestamps, sizes)`
Computes interval mean/CV and a jitter-tolerant regularity score, with a payload-size bonus.

## Usage

```bash
python scripts/analyst.py beacon conn.json --min-events 8
```

## Sources

- MITRE ATT&CK T1071 Application Layer Protocol — https://attack.mitre.org/techniques/T1071/
- Inter-arrival timing / coefficient-of-variation beacon detection — Active Countermeasures
  (RITA methodology), general network-hunting practice
- Jitter as a C2 evasion technique requiring tolerance-based scoring, established practice
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall