Skip to content
Agentmart
Submit a tool

analyzing-command-and-control-communication

分析恶意软件命令与控制(C2)通信协议,以了解 beacon 模式、命令结构、数据编码和基础设施。 涵盖 HTTP、HTTPS、DNS 和自定义协议 C2 分析,用于检测规则开发和威胁情报。 适用于 C2 分析、beacon 检测、C2 协议逆向工程或命令与控制基础设施绘图相关请求。

Skill by killvxk

IndexedApache-2.0★ 57
Write a review

Chalk Labs

Need help deploying analyzing-command-and-control-communication?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/killvxk-analyzing-command-and-control-communication

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

分析恶意软件命令与控制(C2)通信协议,以了解 beacon 模式、命令结构、数据编码和基础设施。 涵盖 HTTP、HTTPS、DNS 和自定义协议 C2 分析,用于检测规则开发和威胁情报。 适用于 C2 分析、beacon 检测、C2 协议逆向工程或命令与控制基础设施绘图相关请求。

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/analyzing-command-and-control-communication

What's inside

Skill name
analyzing-command-and-control-communication
Description
分析恶意软件命令与控制(C2)通信协议,以了解 beacon 模式、命令结构、数据编码和基础设施。 涵盖 HTTP、HTTPS、DNS 和自定义协议 C2 分析,用于检测规则开发和威胁情报。 适用于 C2 分析、beacon 检测、C2 协议逆向工程或命令与控制基础设施绘图相关请求。
License
Apache-2.0
Instructions
373 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts
  • Instructions call the network

Files (4)

  • LICENSE
  • SKILL.md
  • api-reference.md · references/
  • agent.py · scripts/

SKILL.md (first lines)

# 分析命令与控制通信

## 适用场景

- 对恶意软件样本的逆向工程揭示了需要协议分析的网络通信
- 为特定 C2 框架(Cobalt Strike、Metasploit、Sliver)构建网络级检测签名
- 绘制 C2 基础设施图,包括主服务器、备用域名和投弃站
- 分析加密或编码的 C2 流量以了解命令集和数据格式
- 基于 C2 基础设施模式和工具对恶意软件进行威胁行为者溯源归因

**不适用于**一般网络异常检测;本技能专门用于从恶意软件分析中了解已知或疑似 C2 协议。

## 前置条件

- 恶意软件网络流量的 PCAP 捕获(来自沙箱、网络分流或全包捕获)
- Wireshark/tshark 用于数据包级分析
- 逆向工程工具(Ghidra、dnSpy)用于了解恶意软件二进制文件中的 C2 代码
- Python 3.8+,安装 `scapy`、`dpkt` 和 `requests` 用于协议分析和重放
- 威胁情报数据库用于 C2 基础设施关联(VirusTotal、Shodan、Censys)
- JA3/JA3S 指纹数据库用于基于 TLS 的 C2 识别

## 工作流程

### 步骤 1:识别 C2 通道

确定用于 C2 通信的协议和传输方式:

```
C2 通信通道:
━━━━━━━━━━━━━━━━━━━━━━━━━
HTTP/HTTPS:    最常见;使用标准 Web 流量进行混入
                指标:定期 POST/GET 请求、特定 URI 模式、自定义请求头

DNS:           通过 DNS 查询和响应进行数据隧道传输
                指标:大量 TXT 查询、长子域名、高熵值

自定义 TCP/UDP:使用非标准端口的私有二进制协议
                指标:高端口上的非 HTTP 流量、未知协议

ICMP:          编码在 ICMP 回显/回复载荷中的数据
                指标:具有大型或非标准载荷的 ICMP 数据包

WebSocket:     用于实时 C2 的持久双向连接
                指标:WebSocket 升级后跟随二进制帧

云服务:        使用合法 API(Telegram、Discord、Slack、GitHub)
                指标:非预期进程向云服务进行 API 调用

电子邮件:      使用 SMTP/IMAP 进行 C2 命令和数据外泄
                指标:非电子邮件进程的自动化邮件操作
```

### 步骤 2:分析 Beacon 模式

对周期性通信模式进行特征分析:

```python
from scapy.all import rdpcap, IP, TCP
from collections import defaultdict
import statistics
import json

packets = rdpcap("c2_traffic.pcap")

# 按目标分组 TCP SYN 数据包
connections = defaultdict(list)
for pkt in packets:
    if IP in pkt and TCP in pkt and (pkt[TCP].flags & 0x02):
        key = f"{pkt[IP].dst}:{pkt[TCP].dport}"
        connections[key].append(float(pkt.time))

# 分析每个目标的 beacon 行为
for dst, times in sorted(connections.items()):
    if len(times) < 3:
        continue

    intervals = [times[i+1] - times[i] for i in range(len(times)-1)]
    avg_interval = statistics.mean(intervals)
    stdev = statistics.stdev(intervals) if len(intervals) > 1 else 0
    jitter_pct = (stdev / avg_interval * 100) if avg_interval > 0 else 0
    duration = times[-1] - times[0]

    beacon_data = {
        "destination": dst,
        "connections": len(times),
        "duration_seconds": round(duration, 1),
        "avg_interval_seconds": round(avg_interval, 1),
        "stdev_seconds": round(stdev, 1),
        "jitter_percent": round(jitter_pct, 1),
        "is_beacon": 5 < avg_interval < 7200 and jitter_pct < 25,
    }

    if beacon_data["is_beacon"]:
        print(f"[!] 检测到 BEACON:{dst}")
        print(f"    间隔:{avg_interval:.0f}s +/- {stdev:.0f}s({jitter_pct:.0f}% 抖动)")
        print(f"    会话:{len(times)} 次,持续 {duration:.0f}s")
```

### 步骤 3:解码 C2 协议结构

从捕获的流量中逆向工程消息格式:

```python
# 基于 HTTP 的 C2 协议分析
import dpkt
import base64

with open("c2_traffic.pcap", "rb") as f:
    pcap = dpkt.pcap.Reader(f)

for ts, buf in pcap:
    eth = dpkt.ethernet.Ethernet(buf)
    if not isinstance(eth.data, dpkt.ip.IP):
        continue
    ip = eth.data
    if not isinstance(ip.data, dpkt.tcp.TCP):
        continue
    tcp = ip.data

From killvxk/cybersecurity-skills-zh, Apache-2.0.

More from killvxk/cybersecurity-skills-zh

Signals

Stars
57
Forks
14
Open issues
1
Last commit (this folder)
Mar 17, 2026 (7 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from killvxk

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get analyzing-command-and-control-communication running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying analyzing-command-and-control-communication?

CallGet help
Cite this page

analyzing-command-and-control-communication skill. Agent Mart. https://agentmart.dev/skills/killvxk-analyzing-command-and-control-communication (last updated 2026-10-24)