Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-network-packets-with-scapy -a claude-code
Open on GitHub

What 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 pcap and pcapng captures
  • 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.pcap with Scapy and show the protocol distribution.
  • Check this capture for SYN flood patterns and fragmented packets.
  • Extract DNS queries from traffic.pcapng and 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-code

2Manually: put the files in place

~/.claude/skills/analyzing-network-packets-with-scapy/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/analyzing-network-packets-with-scapy/

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

Similar skills

Everything for Security →

From the same set89

analyzing-sbom-for-supply-chain-vulnerabilities Parses CycloneDX and SPDX SBOM files, matches components against the NVD CVE database through the NVD 2.0 API and builds a dependency graph. Useful when you need to size up third-party library risk. CX Codex +1 444installs abusing-dpapi-for-credential-access Guides extraction and decryption of Windows DPAPI secrets, including Credential Manager entries and browser data. Useful during authorized penetration tests after gaining host access. CX Codex +1 442installs analyzing-linux-kernel-rootkits This skill looks for kernel-level rootkits in Linux memory dumps and live systems. Use it during incident investigations and digital forensics. CX Codex +1 442installs analyzing-golang-malware-with-ghidra Walks an agent through Go binary analysis in Ghidra: buildinfo, pclntab, function names, dependencies. Useful when the sample is Go-compiled. CX Codex +1 441installs analyzing-ios-app-security-with-objection A skill for runtime iOS app testing with Objection and Frida: dump the keychain, bypass SSL pinning, check jailbreak detection. CX Codex +1 436installs implementing-secret-scanning-with-gitleaks This skill helps configure Gitleaks to find secrets in Git repositories and stop them from entering history. Use it for local hooks and CI/CD checks. CX Codex +1 439installs testing-for-json-web-token-vulnerabilities Guides coding agents through auditing JWT implementations for none-algorithm bypass, RS256-to-HS256 confusion, kid injection, and weak secrets. CX Codex +1 431installs analyzing-network-traffic-for-incidents A skill that works through packet captures and flow data during an incident: C2 channels, lateral movement, data exfiltration. CX Codex +1 430installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor