analyzing-network-packets-with-scapy — Claude Code skill
This skill guides packet analysis with Scapy, from pcap parsing to anomalous traffic checks. Use it for authorised testing and protocol-level network forensics.
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-network-packets-with-scapy -a claude-codeWhat analyzing-network-packets-with-scapy does
The skill provides a Scapy workflow for reading pcap and pcapng files, dissecting TCP, UDP, ICMP, and DNS packets, and extracting protocol fields. It covers traffic statistics such as protocol distribution, port frequency, and active endpoints.
Its steps examine TCP flag ratios for SYN flood patterns and inspect DNS query length and entropy for exfiltration indicators. It also covers custom probe packets for authorised testing, with findings exported as a JSON report containing anomalies and per-flow summaries.
You need Python 3.8+ with scapy. Capturing or sending packets requires root or administrator privileges, plus Npcap on Windows or libpcap on Linux; that is a reason to confirm permission for work on the target network first.
What it helps with
- parse
pcapandpcapngcaptures - extract TCP, UDP, ICMP, and DNS fields
- detect SYN flood patterns from TCP flags
- inspect DNS queries for tunnelling indicators
- export traffic findings as a JSON report
Example prompts for the agent
- Analyse
capture.pcapwith Scapy and show the protocol distribution. - Check this capture for SYN flood patterns and fragmented packets.
- Extract DNS queries from
traffic.pcapngand assess their length and entropy.
How to install analyzing-network-packets-with-scapy
1Skills CLI (Vercel)
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-network-packets-with-scapy -a claude-code2Manually: put the files in place
~/.claude/skills/analyzing-network-packets-with-scapy/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/analyzing-network-packets-with-scapy/
1Skills CLI (Vercel)
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-network-packets-with-scapy -a codex2Manually: put the files in place
.agents/skills/analyzing-network-packets-with-scapy/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-network-packets-with-scapy -a cursor2Manually: put the files in place
.cursor/skills/analyzing-network-packets-with-scapy/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install mukul975/Anthropic-Cybersecurity-Skills analyzing-network-packets-with-scapy2Manually: put the files in place
.github/skills/analyzing-network-packets-with-scapy/SKILL.md1Skills CLI (Vercel)
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-network-packets-with-scapy -a gemini-cli2Platform CLI
gemini skills install https://github.com/mukul975/Anthropic-Cybersecurity-Skills --path skills/analyzing-network-packets-with-scapyManually: put the files in place
.devin/skills/analyzing-network-packets-with-scapy/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-network-packets-with-scapy -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about analyzing-network-packets-with-scapy
How do I install analyzing-network-packets-with-scapy in Claude Code?
Run npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-network-packets-with-scapy -a claude-code, then run npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-network-packets-with-scapy -a claude-code again. The skill file is at ~/.claude/skills/analyzing-network-packets-with-scapy/SKILL.md.
What does analyzing-network-packets-with-scapy do?
It guides Scapy-based packet capture analysis, protocol field extraction, and traffic anomaly checks. It also covers custom probe packets for authorised network testing.
What is required to capture packets with Scapy?
You need Python 3.8+ with scapy, root or administrator privileges, and Npcap on Windows or libpcap on Linux. Packet operations require authorisation for the target network.
Source text
SKILL.md · Apache-2.0
--- name: analyzing-network-packets-with-scapy description: 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. domain: cybersecurity subdomain: network-security tags: - scapy - packet-analysis - network-forensics - protocol-dissection - pcap - traffic-analysis version: '1.0' author: mahipal license: Apache-2.0 nist_csf: - PR.IR-01 - DE.CM-01 - ID.AM-03 - PR.DS-02 mitre_attack: - T1040 - T1071 - T1046 - T1557 --- # 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 `scapy` library 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 1. Read and parse pcap/pcapng files with `rdpcap()` for offline analysis 2. Extract protocol layers (IP, TCP, UDP, DNS, HTTP) and field values 3. Compute traffic statistics: top talkers, protocol distribution, port frequency 4. Detect SYN flood patterns by analyzing TCP flag ratios 5. Identify DNS exfiltration indicators via query length and entropy analysis 6. Craft custom probe packets for authorized network testing 7. 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.
© mahipal · Apache-2.0 · mukul975/Anthropic-Cybersecurity-Skills