Communitygithub.com

Scapy를 이용한 네트워크 패킷 분석

Scapy를 사용하여 TCP/UDP/ICMP/DNS 패킷을 제작, 전송, 스니핑 및 분석하고, pcap 파일을 분석하며, SYN 스캔을 구현하고, 조각화되거나 변조된 패킷과 같은 비정상 트래픽을 탐지합니다. 승인된 네트워크 정찰, 프로토콜 수준 포렌식 분석 또는 보안 테스트 중 트래픽 이상 탐지에 사용하세요.

Scapy를 이용한 네트워크 패킷 분석란 무엇인가요?

이 스킬은 Python 기반 패킷 조작 라이브러리인 Scapy를 사용하여 네트워크 패킷을 심층 분석하고 보안 관련 작업을 수행하는 방법을 제공합니다. Scapy는 패킷 제작, 전송, 스니핑, 해석을 지원하며, 본 스킬은 TCP/UDP/ICMP 패킷 제작, pcap 파일 분석, 프로토콜 필드 추출, SYN 스캔 구현, DNS 쿼리 분석, 비정상적으로 조각화된 패킷이나 변조된 헤더 탐지 등 보안 테스트 및 포렌식 분석에 필요한 핵심 기능을 다룹니다. 또한, SYN 플러드 패턴 탐지, DNS 터널링 지표 분석, 사용자 정의 프로브 패킷 제작과 같은 고급 분석 기법을 포함하여, SOC 분석가나 보안 엔지니어가 승인된 환경에서 침해 사고 대응, 탐지 규칙 구축, 모니터링 범위 검증을 수행할 수 있도록 체계적인 절차를 제시합니다. 지원하는 플랫폼은 Python 3.8+ 환경이며, 추가 도구로 Npcap(Windows) 또는 libpcap(Linux)이 필요합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-network-packets-with-scapy

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Scapy를 이용한 네트워크 패킷 분석은(는) 무엇을 하나요?

개요

Scapy는 세분화된 프로토콜 계층에서 네트워크 패킷을 제작, 전송, 스니핑 및 해석할 수 있는 Python 패킷 조작 라이브러리입니다. 이 스킬은 TCP/UDP/ICMP 패킷 제작, pcap 파일 분석, 프로토콜 필드 추출, SYN 스캔 구현, DNS 쿼리 분석, 비정상적으로 조각화된 패킷이나 변조된 헤더와 같은 비정상 트래픽 패턴 탐지 등 보안 관련 작업에 Scapy를 사용하는 방법을 다룹니다.

사용 시기

  • Scapy를 사용한 네트워크 패킷 분석이 필요한 보안 사고를 조사할 때
  • 이 도메인에 대한 탐지 규칙 또는 위협 헌팅 쿼리를 구축할 때
  • SOC 분석가에게 이 분석 유형에 대한 체계적인 절차가 필요할 때
  • 관련 공격 기술에 대한 보안 모니터링 범위를 검증할 때

사전 요구 사항

  • scapy 라이브러리가 설치된 Python 3.8+ (pip install scapy)
  • 원시 소켓 작업(스니핑, 전송)을 위한 루트/관리자 권한
  • 패킷 캡처를 위한 Npcap(Windows) 또는 libpcap(Linux)
  • 대상 네트워크에서 패킷 작업 수행에 대한 승인

단계

  1. 오프라인 분석을 위해 rdpcap()을 사용하여 pcap/pcapng 파일 읽기 및 구문 분석
  2. 프로토콜 계층(IP, TCP, UDP, DNS, HTTP) 및 필드 값 추출
  3. 트래픽 통계 계산: 주요 트래픽 발생자, 프로토콜 분포, 포트 빈도
  4. TCP 플래그 비율 분석을 통한 SYN 플러드 패턴 탐지
  5. 쿼리 길이 및 엔트로피 분석을 통한 DNS 유출 지표 식별
  6. 승인된 네트워크 테스트를 위한 사용자 정의 프로브 패킷 제작
  7. 결과를 구조화된 JSON 보고서로 내보내기

예상 출력

패킷 통계, 프로토콜 분포, 주요 소스/대상 IP, 탐지된 이상 징후(SYN 플러드, DNS 터널링 지표, 조각화 공격) 및 플로우별 요약을 포함한 JSON 보고서입니다.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

abusing-dpapi-for-credential-access

Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using SharpDPAPI, SharpChrome, Mimikatz, or Impacket

abusing-shadow-credentials-for-privesc

Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, or Certipy, then authenticate via PKINIT to recover the target

achieving-cmmc-level-2-compliance

>-

acquiring-disk-image-with-dd-and-dcfldd

Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification (MD5/SHA) during acquisition. Use when imaging a suspect drive, USB device, or memory card for investigation, preserving volatile disk evidence during incident response, or producing a verified copy for legal or law-enforcement proceedings before any destructive analysis.

analyzing-active-directory-acl-abuse

Detect dangerous ACL misconfigurations in Active Directory using ldap3

analyzing-android-malware-with-apktool

Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection, dangerous permission-combination detection, and identification of obfuscated code, dynamic code loading, and reflection-based API calls. Use to statically triage a suspicious APK without executing it or to build mobile malware detection rules.

analyzing-api-gateway-access-logs

Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect

analyzing-apt-group-with-mitre-navigator

Query ATT&CK data with attackcti, mitreattack-python, and stix2, then build MITRE ATT&CK Navigator layers and multi-layer heatmap overlays mapping one or more APT groups

analyzing-azure-activity-logs-for-threats

Queries Azure Monitor activity logs and sign-in logs via azure-monitor-query

analyzing-bootkit-and-rootkit-samples

Analyzes bootkit and advanced rootkit malware infecting the Master

analyzing-browser-forensics-with-hindsight

Parse Chromium-based browser databases with Hindsight to extract and correlate browsing history, downloads, cookies, cached content, autofill data, saved passwords, and extensions from Chrome, Edge, Brave, Opera, and Vivaldi into a unified timeline (XLSX, JSON, or SQLite output). Use during incident response, insider-threat investigations, or criminal cases when you need to reconstruct a user

analyzing-campaign-attribution-evidence

Systematically evaluate cyber-campaign evidence to attribute an operation to a threat actor, using the Diamond Model and Analysis of Competing Hypotheses (ACH) to weigh infrastructure overlaps, TTP consistency, malware code similarity, and timing/language artifacts into confidence-weighted attribution assessments. Use when an incident investigation needs a defensible attribution confidence level.

analyzing-certificate-transparency-for-phishing

Monitor Certificate Transparency logs using crt.sh and Certstream to

analyzing-cloud-storage-access-patterns

Detect abnormal access in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics for after-hours bulk downloads, new-IP access, and API-call spikes (e.g. GetObject) via statistical baselines and time-series anomaly detection. Use when investigating suspected cloud data exfiltration or building related detection rules.

analyzing-cobalt-strike-beacon-configuration

Extract and analyze Cobalt Strike beacon configuration from PE files

analyzing-cobaltstrike-malleable-c2-profiles

Parse and analyze Cobalt Strike Malleable C2 profiles with dissect.cobaltstrike (profiles and beacon-payload configs) and pyMalleableC2 (AST parsing) to extract HTTP/DNS transforms, URIs, headers, sleep/jitter, and injection behavior, then generate network detection signatures. Use when reverse-engineering a captured malleable profile or building detections against Cobalt Strike Beacon traffic.

analyzing-command-and-control-communication

Analyzes malware C2 communication over HTTP, HTTPS, DNS, and custom

analyzing-cyber-kill-chain

Analyzes intrusion activity against the Lockheed Martin Cyber Kill Chain

analyzing-disk-image-with-autopsy

Perform comprehensive forensic analysis of raw (dd), E01, or AFF disk images with Autopsy and The Sleuth Kit, recovering deleted files, examining metadata and embedded artifacts, keyword searching, and building investigation timelines with visual reports. Use for structured analysis of a forensic disk image or when stakeholders need visual reports from evidence.

analyzing-dns-logs-for-exfiltration

Analyzes DNS query logs to detect data exfiltration via DNS tunneling,

관련 스킬