Communitygithub.com

네트워크 트래픽 분석을 통한 침해사고 대응

보안 침해사고 발생 시 네트워크 트래픽 캡처 및 플로우 데이터를 분석하여 공격자 활동을 식별합니다.

네트워크 트래픽 분석을 통한 침해사고 대응란 무엇인가요?

이 스킬은 보안 침해사고 대응 중 네트워크 트래픽(PCAP, NetFlow, Zeek 로그)을 분석하여 C2 통신, 측면 이동, 데이터 유출 등 공격자 활동을 식별하는 방법을 제공합니다. SIEM 경보 확인, C2 비콘닝 탐지, 데이터 유출량 정량화, IDS/IPS 경보 검증 등 다양한 시나리오에서 활용할 수 있습니다. Wireshark, Zeek, Arkime 등 주요 네트워크 포렌식 도구를 사용하며, tcpdump 캡처 명령어부터 고급 Wireshark 필터, Zeek 로그 분석까지 단계별 워크플로우를 포함합니다. 주요 기능으로는 비콘닝 패턴 탐지, SMB/RDP/WMI 등 측면 이동 프로토콜 분석, DNS 터널링 및 대용량 전송 탐지를 통한 데이터 유출 식별, IOC 추출 및 증거 문서화가 있습니다. 호스트 기반 포렌식은 포함하지 않으며 네트워크 계층 분석에 특화되어 있습니다.

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

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

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

문서

침해사고 대응을 위한 네트워크 트래픽 분석

사용 시점

  • SIEM에서 이상 네트워크 트래픽 패턴 경보가 발생하여 심층 조사가 필요할 때
  • C2 비콘닝이 의심되어 패킷 수준 분석을 통한 확인이 필요할 때
  • 네트워크 증거로부터 데이터 유출량 또는 유출 대상을 정량화해야 할 때
  • 네트워크 연결을 통해 시스템 간 측면 이동 경로를 추적해야 할 때
  • IDS/IPS 경보를 패킷 수준에서 검증하여 확인 또는 기각해야 할 때

사용하지 말아야 할 경우: 호스트 기반 포렌식 분석(프로세스 실행, 파일 시스템 아티팩트)은 엔드포인트 포렌식 도구를 사용하세요.

전제 조건

  • 전체 패킷 캡처(PCAP) 인프라 또는 주문형 캡처 기능(네트워크 탭, SPAN 포트)
  • 분석 워크스테이션에 Wireshark 설치 및 적절한 디스플레이 필터 지식
  • 네트워크 메타데이터 생성을 위한 Zeek(구 Bro) 배포(conn.log, dns.log, http.log, ssl.log)
  • 트래픽 플로우 분석을 위한 네트워크 장비의 NetFlow/IPFIX 수집
  • VLAN 레이아웃, 방화벽 위치, 모니터링 지점을 보여주는 네트워크 아키텍처 다이어그램
  • 관찰된 네트워크 지표 상관 관계 분석을 위한 위협 인텔리전스 피드

워크플로우

1단계: 네트워크 트래픽 캡처 또는 확보

조사에 필요한 관련 트래픽 데이터를 확보합니다:

실시간 캡처(침해사고 진행 중인 경우):

# 특정 호스트로 필터링하여 인터페이스에서 캡처
tcpdump -i eth0 -w capture.pcap host 10.1.5.42

# 특정 외부 IP로의 C2 트래픽 캡처
tcpdump -i eth0 -w c2_traffic.pcap host 185.220.101.42

# 로테이션 캡처(1GB 파일, 10개 유지)
tcpdump -i eth0 -w capture_%Y%m%d%H%M.pcap -C 1000 -W 10

기존 인프라에서 가져오기:

  • 전체 패킷 캡처 어플라이언스(Arkime/Moloch, ExtraHop, Corelight)에서 PCAP 내보내기
  • 조사 시간대에 해당하는 Zeek 클러스터의 Zeek 로그 가져오기
  • 고수준 트래픽 분석을 위해 네트워크 장비의 NetFlow 데이터 내보내기

2단계: C2 통신 식별

명령 및 제어 트래픽 패턴 탐지:

비콘닝 탐지(Zeek conn.log):

# 정기적인 간격으로 외부 IP에 대한 연결 추출
cat conn.log | zeek-cut ts id.orig_h id.resp_h id.resp_p duration orig_bytes resp_bytes \
  | awk '$4 ~ /^185\.220/' | sort -t. -k1,1n -k2,2n

Wireshark 비콘 분석:

# 의심스러운 C2 IP로의 트래픽 필터
ip.addr == 185.220.101.42

# 비표준 포트의 HTTPS 트래픽 필터
tcp.port != 443 && ssl

# 의심스러운 도메인에 대한 DNS 쿼리 필터
dns.qry.name contains "evil" or dns.qry.name matches "^[a-z0-9]{32}\."

# HTTP POST (일반적인 C2 체크인 방식) 필터
http.request.method == "POST" && ip.dst == 185.220.101.42

식별할 비콘닝 특성:

  • 연결 간 일정한 시간 간격(예: 60초마다, 10-15% 지터 포함)
  • 요청 및 응답의 일관된 패킷 크기
  • 합법적인 CDN 또는 서비스와 연결되지 않은 외부 IP로의 HTTPS
  • 높은 엔트로피 서브도메인을 포함한 DNS 쿼리(DNS 터널링 지표)

3단계: 측면 이동 트래픽 분석

내부 시스템 간 공격자 이동 추적:

측면 이동 탐지를 위한 주요 프로토콜:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SMB (TCP 445):     PsExec, 파일 공유 액세스, 랜섬웨어 전파
RDP (TCP 3389):    원격 데스크톱 세션
WinRM (TCP 5985):  PowerShell 원격 관리
WMI (TCP 135):     원격 명령 실행
SSH (TCP 22):      Linux 측면 이동
DCE/RPC (TCP 135): DCOM 기반 측면 이동

측면 이동용 Wireshark 필터:

# SMB 측면 이동
smb2 && ip.src == 10.1.5.42 && ip.dst != 10.1.5.42

# 손상된 호스트에서의 RDP 연결
tcp.dstport == 3389 && ip.src == 10.1.5.42

# Kerberos 티켓 요청 (패스-더-티켓 가능성)
kerberos.msg_type == 12 && ip.src == 10.1.5.42

# NTLM 인증 (패스-더-해시 가능성)
ntlmssp.auth.username && ip.src == 10.1.5.42

4단계: 데이터 유출 탐지

네트워크를 벗어나는 무단 데이터 전송 식별:

# Zeek conn.log에서 대규모 아웃바운드 전송 식별
cat conn.log | zeek-cut ts id.orig_h id.resp_h id.resp_p orig_bytes \
  | awk '$5 > 100000000' | sort -t$'\t' -k5 -rn

# DNS 터널링 탐지 (대량의 TXT 쿼리)
cat dns.log | zeek-cut query qtype | grep TXT | cut -f1 \
  | rev | cut -d. -f1,2 | rev | sort | uniq -c | sort -rn | head

# 비정상 프로토콜 사용 (ICMP 터널링, DNS over HTTPS)
cat conn.log | zeek-cut proto id.resp_p orig_bytes | awk '$1 == "icmp" && $3 > 1000'

Wireshark 유출 필터:

# 대용량 HTTP POST 업로드
http.request.method == "POST" && tcp.len > 10000

# FTP 데이터 전송
ftp-data && ip.src == 10.0.0.0/8

# 대용량 TXT 응답이 포함된 DNS (터널링)
dns.resp.type == 16 && dns.resp.len > 200

5단계: IOC 추출 및 상관 관계 분석

트래픽 분석에서 네트워크 기반 지표 추출:

  • 손상된 호스트가 접촉한 외부 IP 주소
  • 침해사고 시간대에 DNS를 통해 확인된 도메인
  • HTTP/HTTPS를 통해 접근한 URL(SSL 검사가 활성화된 경우)
  • TLS 인증서 세부 정보(주체, 발급자, 일련번호, JA3/JA3S 해시)
  • HTTP 요청의 User-Agent 문자열
  • PCAP에서 캡처된 파일 전송(Wireshark Export Objects 사용하여 추출)

6단계: 네트워크 포렌식 결과 문서화

분석 내용을 증거 참조와 함께 구조화된 보고서로 정리:

  • 각 결과에 대해 특정 PCAP 파일, 프레임 번호 및 타임스탬프 참조
  • 주요 증거의 패킷 캡처를 스크린샷 또는 PDF로 내보내기 포함
  • 네트워크 활동을 침해사고 타임라인에 매핑
  • 네트워크 결과를 엔드포인트 포렌식의 호스트 기반 증거와 상관 관계 분석

주요 개념

용어정의
PCAP (Packet Capture)네트워크 인터페이스에서 캡처된 원시 네트워크 패킷을 저장하는 파일 형식으로 오프라인 분석에 사용
비콘닝 (Beaconing)손상된 호스트에서 C2 서버로의 정기적이고 주기적인 네트워크 연결로, 일관된 타이밍 간격으로 식별 가능
JA3/JA3SClientHello 및 ServerHello 매개변수를 기반으로 한 TLS 클라이언트 및 서버 지문 인증 방법; 애플리케이션별로 고유
NetFlow/IPFIX라우터와 스위치에서 수집한 네트워크 트래픽 메타데이터(소스, 대상, 포트, 바이트, 지속 시간)로 전체 패킷 캡처 없이 제공
DNS 터널링DNS 쿼리와 응답에 데이터를 인코딩하여 DNS 프로토콜을 통해 데이터를 유출하거나 C2를 유지하는 기술
네트워크 탭네트워크 성능에 영향을 주지 않고 모니터링을 위해 네트워크 트래픽의 정확한 복사본을 생성하는 하드웨어 장치
Zeek 로그Zeek 네트워크 분석 프레임워크에서 생성된 구조화된 메타데이터 로그로, 연결, DNS, HTTP, SSL 등을 포함

도구 및 시스템

  • Wireshark: 패킷 수준에서 네트워크 프로토콜을 심층 검사하는 오픈 소스 패킷 분석기
  • Zeek(구 Bro): 실시간 또는 캡처된 트래픽에서 구조화된 메타데이터 로그를 생성하는 네트워크 분석 프레임워크
  • Arkime(구 Moloch): 대규모 네트워크 포렌식을 위한 오픈 소스 전체 패킷 캡처 및 검색 플랫폼
  • NetworkMiner: PCAP 파일에서 파일, 이미지, 자격 증명을 추출하는 네트워크 포렌식 분석 도구
  • RITA (Real Intelligence Threat Analytics): Zeek 로그를 위한 오픈 소스 비콘 탐지 및 DNS 터널링 분석 도구

일반적인 시나리오

시나리오: C2 비콘닝 확인 및 유출량 정량화

컨텍스트: EDR이 워크스테이션에서 의심스러운 프로세스를 감지했지만 유출된 데이터량을 확인할 수 없습니다. 네트워크 팀이 침해사고 시간대를 포함하는 전체 패킷 캡처 어플라이언스의 PCAP을 제공합니다.

접근법:

  1. PCAP을 손상된 호스트 IP에서 외부 대상으로의 트래픽으로 필터링
  2. 연결 타이밍 패턴 분석을 통해 C2 채널 식별(비콘 탐지)
  3. C2 연결에서 TLS 인증서 및 JA3 해시 추출하여 IOC 생성
  4. 침해사고 지속 시간 동안 C2 인프라로 전송된 총 바이트 계산
  5. 추가 유출 채널 확인(DNS 터널링, 클라우드 저장소 업로드)
  6. Wireshark Export Objects 기능을 사용하여 전송된 암호화되지 않은 파일 추출

주의할 점:

  • SSL 검사 없이 C2가 HTTPS로 작동 중일 때 HTTP 트래픽만 분석하는 경우
  • 쿼리당 데이터 양이 적어 DNS 터널링을 놓치는 경우(그러나 시간 경과에 따른 총량은 중요함)
  • 네트워크 타임스탬프와 엔드포인트 타임스탬프를 상관 분석하지 않는 경우(시간대 불일치)
  • 유출에 악용된 합법적인 클라우드 서비스(OneDrive, Google Drive, Dropbox)를 간과하는 경우

출력 형식

네트워크 트래픽 분석 보고서
=================================
침해사고:         INC-2025-1547
분석가:           [이름]
캡처 소스:        Arkime 전체 패킷 캡처
분석 기간:        2025-11-15 14:00 UTC - 2025-11-15 18:00 UTC
총 PCAP 크기:     4.7 GB

C2 통신
소스:            10.1.5.42 (WKSTN-042)
대상:            185.220.101.42:443 (HTTPS)
비콘 간격:       60초 ± 12% 지터
세션:            4시간 동안 237개 연결
JA3 해시:        a0e9f5d64349fb13191bc781f81f42e1
TLS 인증서:      CN=update.evil[.]com (자체 서명)
전송된 총 데이터: 147 MB (아웃바운드)
수신된 총 데이터: 2.3 MB (인바운드 - 명령)

측면 이동
10.1.5.42 → 10.1.10.15 (SMB, TCP 445) - 14:35 UTC
10.1.5.42 → 10.1.10.20 (RDP, TCP 3389) - 14:42 UTC
10.1.5.42 → 10.1.1.5  (LDAP, TCP 389) - 15:10 UTC

유출 요약
프로토콜:        C2 서버로의 HTTPS
볼륨:            147 MB 아웃바운드
지속 시간:       14:23 UTC - 18:00 UTC
추출된 파일:     [암호화되지 않은 채널에서 복구 가능한 경우 목록]

DNS 분석
의심스러운 쿼리: 0개 DNS 터널링 지표
DGA 탐지:       0개 알고리즘 생성 도메인

증거 참조
PCAP 파일:       INC-2025-1547_capture.pcap (SHA-256: ...)
Zeek 로그:       /logs/zeek/2025-11-15/ (conn.log, ssl.log, dns.log)

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,

관련 스킬