analyzing-network-packets-with-scapy
$
npx mdskill add mukul975/Anthropic-Cybersecurity-Skills/analyzing-network-packets-with-scapyCraft, sniff, and dissect network packets using Scapy for deep protocol analysis and security testing.
- Investigate security incidents requiring detailed network traffic examination.
- Requires the Python `scapy` library and root privileges for raw socket access.
- Executes structured procedures for threat hunting and detection rule validation.
- Delivers extracted data, analysis results, and identified traffic anomalies.
SKILL.md
.github/skills/analyzing-network-packets-with-scapyView on GitHub ↗
--- name: analyzing-network-packets-with-scapy description: Craft, send, sniff, and dissect network packets using Scapy for protocol analysis, network reconnaissance, and traffic anomaly detection in authorized 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 --- # 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.
More from mukul975/Anthropic-Cybersecurity-Skills
- acquiring-disk-image-with-dd-and-dcflddCreate forensically sound bit-for-bit disk images using dd and dcfldd while preserving evidence integrity through hash verification.
- analyzing-active-directory-acl-abuseDetect dangerous ACL misconfigurations in Active Directory using ldap3 to identify GenericAll, WriteDACL, and WriteOwner abuse paths
- analyzing-android-malware-with-apktoolPerform static analysis of Android APK malware samples using apktool for decompilation, jadx for Java source recovery, and androguard for permission analysis, manifest inspection, and suspicious API call detection.
- analyzing-api-gateway-access-logs>
- analyzing-apt-group-with-mitre-navigatorAnalyze advanced persistent threat (APT) group techniques using MITRE ATT&CK Navigator to create layered heatmaps of adversary TTPs for detection gap analysis and threat-informed defense.
- analyzing-azure-activity-logs-for-threats>
- analyzing-bootkit-and-rootkit-samples>
- analyzing-browser-forensics-with-hindsightAnalyze Chromium-based browser artifacts using Hindsight to extract browsing history, downloads, cookies, cached content, autofill data, saved passwords, and browser extensions from Chrome, Edge, Brave, and Opera for forensic investigation.
- analyzing-campaign-attribution-evidenceCampaign attribution analysis involves systematically evaluating evidence to determine which threat actor or group is responsible for a cyber operation. This skill covers collecting and weighting attr
- analyzing-certificate-transparency-for-phishingMonitor Certificate Transparency logs using crt.sh and Certstream to detect phishing domains, lookalike certificates, and unauthorized certificate issuance targeting your organization.