Analyzes PCAPs, Zeek logs, and NetFlow data to detect C2 beacons, lateral movement, data exfiltration, and exploit attempts in security incidents using Wireshark and tcpdump.
npx claudepluginhub killvxk/cybersecurity-skills-zhThis skill uses the workspace's default tool permissions.
- SIEM 告警显示异常网络流量模式,需要深入调查
Analyzes PCAP files, Zeek logs, and NetFlow data to detect C2 communications, lateral movement, data exfiltration, and exploits during security incidents using Wireshark techniques.
Analyzes PCAP captures, Zeek logs, and NetFlow data to detect C2 beaconing, lateral movement, data exfiltration, and exploits in security incidents using Wireshark and bash tools.
Analyzes malware PCAPs from sandbox or incident response using Wireshark, tshark, Zeek, Suricata to detect C2 protocols, data exfiltration, DNS tunneling, payload downloads, and lateral movement.
Share bugs, ideas, or general feedback.
不适用于基于主机的取证分析(进程执行、文件系统制品);此类场景请使用终端取证工具。
获取调查所需的相关流量数据:
实时捕获(事件仍在进行时):
# 在特定接口上按主机过滤进行捕获
tcpdump -i eth0 -w capture.pcap host 10.1.5.42
# 捕获发往特定外部 IP 的 C2 流量
tcpdump -i eth0 -w c2_traffic.pcap host 185.220.101.42
# 带滚动轮转的捕获(每个文件 1GB,保留 10 个)
tcpdump -i eth0 -w capture_%Y%m%d%H%M.pcap -C 1000 -W 10
从现有基础设施获取:
检测命令与控制流量模式:
信标检测(Zeek conn.log):
# 提取具有规律间隔的对外连接
cat conn.log | zeek-cut ts id.orig_h id.resp_h id.resp_p duration orig_bytes resp_bytes \
| awk '$4 ~ /^185\.220/' | sort -t. -k1,1n -k2,2n
Wireshark 信标分析:
# 过滤发往可疑 C2 IP 的流量
ip.addr == 185.220.101.42
# 过滤非标准端口上的 HTTPS 流量
tcp.port != 443 && ssl
# 过滤可疑域名的 DNS 查询
dns.qry.name contains "evil" or dns.qry.name matches "^[a-z0-9]{32}\."
# 过滤 HTTP POST(常见 C2 上线方式)
http.request.method == "POST" && ip.dst == 185.220.101.42
信标特征识别要点:
追踪攻击者在内部系统间的移动路径:
横向移动检测关键协议:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SMB (TCP 445): PsExec、文件共享访问、勒索软件传播
RDP (TCP 3389): 远程桌面会话
WinRM (TCP 5985): PowerShell 远程访问
WMI (TCP 135): 远程命令执行
SSH (TCP 22): Linux 横向移动
DCE/RPC (TCP 135): 基于 DCOM 的横向移动
横向移动的 Wireshark 过滤器:
# SMB 横向移动
smb2 && ip.src == 10.1.5.42 && ip.dst != 10.1.5.42
# 来自失陷主机的 RDP 连接
tcp.dstport == 3389 && ip.src == 10.1.5.42
# Kerberos 票据请求(潜在的票据传递(Pass-the-Ticket))
kerberos.msg_type == 12 && ip.src == 10.1.5.42
# NTLM 认证(潜在的哈希传递(Pass-the-Hash))
ntlmssp.auth.username && ip.src == 10.1.5.42
识别从网络中未经授权的数据传输:
# 在 Zeek conn.log 中识别大量出站传输
cat conn.log | zeek-cut ts id.orig_h id.resp_h id.resp_p orig_bytes \
| awk '$5 > 100000000' | sort -t$'\t' -k5 -rn
# DNS 隧道检测(高量 TXT 查询)
cat dns.log | zeek-cut query qtype | grep TXT | cut -f1 \
| rev | cut -d. -f1,2 | rev | sort | uniq -c | sort -rn | head
# 异常协议使用(ICMP 隧道、DNS over HTTPS)
cat conn.log | zeek-cut proto id.resp_p orig_bytes | awk '$1 == "icmp" && $3 > 1000'
Wireshark 数据外泄过滤器:
# 大型 HTTP POST 上传
http.request.method == "POST" && tcp.len > 10000
# FTP 数据传输
ftp-data && ip.src == 10.0.0.0/8
# 含大型 TXT 响应的 DNS(隧道)
dns.resp.type == 16 && dns.resp.len > 200
从流量分析中提取基于网络的失陷指标:
将分析结果汇编为带证据引用的结构化报告:
| 术语 | 定义 |
|---|---|
| PCAP(数据包捕获) | 存储从网络接口捕获的原始网络数据包的文件格式,用于离线分析 |
| 信标(Beaconing) | 失陷主机向 C2 服务器发出的规律性、周期性网络连接,可通过一致的时间间隔识别 |
| JA3/JA3S | 基于 ClientHello 和 ServerHello 参数的 TLS 客户端和服务器指纹方法;每个应用程序具有唯一指纹 |
| NetFlow/IPFIX | 由路由器和交换机收集的网络流量元数据(源、目标、端口、字节数、持续时间),无需全量数据包捕获 |
| DNS 隧道(DNS Tunneling) | 将数据编码在 DNS 查询和响应中,通过 DNS 协议进行数据外泄或维持 C2 的技术 |
| 网络分路器(Network Tap) | 创建网络流量精确副本用于监控的硬件设备,不影响网络性能 |
| Zeek 日志 | Zeek 网络分析框架生成的结构化元数据日志,涵盖连接、DNS、HTTP、SSL 等 |
场景背景:EDR 在某工作站检测到可疑进程,但无法确定数据外泄量。网络团队提供了覆盖事件时间段的全量数据包捕获设备中的 PCAP。
方法:
常见陷阱:
网络流量分析报告
=================================
事件编号: INC-2025-1547
分析师: [姓名]
捕获来源: Arkime 全量数据包捕获
分析时段: 2025-11-15 14:00 UTC - 2025-11-15 18:00 UTC
PCAP 总大小: 4.7 GB
C2 通信
Source: 10.1.5.42 (WKSTN-042)
Destination: 185.220.101.42:443 (HTTPS)
Beacon Interval: 60 秒 ± 12% 抖动
Sessions: 4 小时内 237 次连接
JA3 Hash: a0e9f5d64349fb13191bc781f81f42e1
TLS Certificate: CN=update.evil[.]com(自签名)
Total Data Sent: 147 MB(出站)
Total Data Recv: 2.3 MB(入站 - 命令)
横向移动
10.1.5.42 → 10.1.10.15 (SMB, TCP 445) - 14:35 UTC
10.1.5.42 → 10.1.10.20 (RDP, TCP 3389) - 14:42 UTC
10.1.5.42 → 10.1.1.5 (LDAP, TCP 389) - 15:10 UTC
数据外泄摘要
Protocol: HTTPS 至 C2 服务器
Volume: 147 MB 出站
Duration: 14:23 UTC - 18:00 UTC
Files Extracted: [如可从未加密通道恢复则列出]
DNS 分析
Suspicious Queries: 0 个 DNS 隧道指标
DGA Detection: 0 个算法生成域名
证据引用
PCAP File: INC-2025-1547_capture.pcap (SHA-256: ...)
Zeek Logs: /logs/zeek/2025-11-15/ (conn.log, ssl.log, dns.log)