analyzing-network-packets-with-scapy
它能做什么
这个工具使用一个名为 Scapy 的程序来检查网络流量。它可以创建、发送和分析数据包,帮助你了解网络是如何工作的,并发现可疑活动。
适用场景
- ✓在调查网络安全问题时使用。
- ✓在测试网络安全性、寻找漏洞时使用。
- ✓在分析记录网络流量的文件时使用。
技能链接
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-network-packets-with-scapy/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“分析这个网络流量文件,告诉我有没有什么异常的地方。”
每周 5 个新技能,1 分钟读完。
工作原理
Scapy 让电脑能够“看到”在网络上传输的数据包。它可以读取这些数据包、提取重要信息,还能创建新的数据包来测试网络。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Analyzing Network Packets with Scapy
Overview
Scapy is a Python packet manipulation library that enables crafting, sending, sniffing, and dissecting network packets at granular protocol layers. This skill covers using Scapy for security-relevant tasks including TCP/UDP/ICMP packet crafting, pcap file analysis, protocol field extraction, SYN scan implementation, DNS query analysis, and detecting anomalous traffic patterns such as unusually fragmented packets or malformed headers.
When to Use
- When investigating security incidents that require analyzing network packets with scapy
- 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
- Python 3.8+ with
scapylibrary installed (pip install scapy) - Root/administrator privileges for raw socket operations (sniffing, sending)
- Npcap (Windows) or libpcap (Linux) for packet capture
- Authorization to perform packet operations on target network
Steps
- Read and parse pcap/pcapng files with
rdpcap()for offline analysis - Extract protocol layers (IP, TCP, UDP, DNS, HTTP) and field values
- Compute traffic statistics: top talkers, protocol distribution, port frequency
- Detect SYN flood patterns by analyzing TCP flag ratios
- Identify DNS exfiltration indicators via query length and entropy analysis
- Craft custom probe packets for authorized network testing
- Export findings as structured JSON report
Expected Output
JSON report containing packet statistics, protocol distribution, top source/destination IPs, detected anomalies (SYN floods, DNS tunneling indicators, fragmentation attacks), and per-flow summaries.
常见问题
我需要是网络专家才能使用吗?
不需要,但了解一些基本的网络知识有助于理解结果。这个工具简化了数据包分析的过程。
什么是网络“数据包”?
数据包是在互联网或局域网中传输的小块数据,就像通过邮件寄送的信件。
分析网络流量的目的是什么?
用来了解数据是如何流动的、发现问题、保障安全,并检查网络是否正常运行。
详情
作者的原始描述
Use Scapy to craft, send, sniff, and dissect TCP/UDP/ICMP/DNS packets, analyze pcap files, implement SYN scans, and detect anomalous traffic such as fragmented or malformed packets. Use when performing authorized network reconnaissance, protocol-level forensic analysis, or building traffic anomaly detection during security testing.
热度
- GitHub 星标
- 35k
- 排名
- #7636
- 许可证
- Apache-2.0
- 更新时间
- 2026/8/31
评论
- …
同一仓库的更多技能
abusing-dpapi-for-credential-access
35k为你的 AI 智能体提供针对特定任务的现成指令,让它完成得更好、更快。
abusing-shadow-credentials-for-privesc
35k教你的 AI 智能体写出清晰、结构良好的文本。
achieving-cmmc-level-2-compliance
35k帮助你的智能体搭建符合 CMMC Level 2 合规要求的环境。它会落实安全要求,并管理必要的文档。
acquiring-disk-image-with-dd-and-dcfldd
35k帮助你的智能体创建硬盘的精确副本。这能确保调查过程中信息不丢失、不被篡改。