π HIERARCHY NETWORK FORENSICS & PCAP ANALYSIS β Dari Wire-Level Bits sampai Application-Layer Reconstruction
Network forensics adalah cabang forensik yang menganalisis lalu lintas jaringan untuk mengungkap aktivitas attacker, exfiltration data, dan pola komunikasi β tanpa membutuhkan akses ke endpoint yang dikompromi. Berbeda dari endpoint forensik (analisis disk/memory), network forensics tidak perlu akses ke komputer korban β cukup tangkapan lalu lintas (PCAP) dari switch/router/SIEM. Hirarki ini memetakan evolusi analisis dari Level 0 (raw bits di kabel) sampai Level 6 (cross-session threat reconstruction) β semakin tinggi levelnya, semakin abstrak analisisnya dan semakin besar kesimpulan yang bisa ditarik.
Cara Baca Atlas Ini
Mulai dari Level 0 untuk memahami data paling mentah (physical layer). Loncat ke Level 3β4 kalau tujuan Anda adalah CTF forensic (PCAP analysis, exfiltration detection). Level 5β6 untuk IR profesional yang merekonstruksi APT campaign. Untuk tools per level, lihat ctf-tool-arsenal-universal β Network Forensic section. Untuk metodologi praktis, lihat network-forensics-pcap-analysis.
Tabel Utama β Level 0 sampai Level 6
| π Level | π§ Layer Analisis | π¦ Bentuk Data | β‘ Tools | π― Pertanyaan yang Dijawab |
|---|---|---|---|---|
| Level 0 β Raw Wire / Physical | Physical layer β bit mentah di kabel/udara | Radio frequency, electrical signal, optical pulse | Wireshark (raw capture), tcpdump, libpcap, RF receiver (HackRF, USRP) | βApakah ada data yang lewat?β β deteksi sinyal, frame synchronization |
| Level 1 β Data Link / Ethernet | Layer 2 β frame MAC, ARP, VLAN, STP | Ethernet frame header + payload, ARP packet, 802.1Q tag | tcpdump -e, Wireshark (Ethernet II), tshark -Y βarpβ, macof | βSiapa yang bicara dengan siapa di switch ini?β β MAC spoofing, ARP spoofing, STP manipulation |
| Level 2 β Network / IP | Layer 3 β IP header, routing, fragmentation | IPv4/IPv6 packet, ICMP, IPsec, TTL, fragmentation offset | Wireshark (IPv4), tshark -Y βipβ, nmap, Scapy | βDari mana ke mana paket ini?β β IP spoofing, traceroute, TTL analysis, fragmentation attack |
| Level 3 β Transport / TCP-UDP | Layer 4 β port, sequence number, flow state | TCP segment (SYN/ACK/RST), UDP datagram, window size, SACK | Wireshark (TCP), tshark -z io,stat, Zeek conn.log, tcptrace | βApakah koneksi ini legitimate?β β SYN flood, port scan, TCP hijack, sequence prediction |
| Level 4 β Application Protocol | Layer 5β7 β protokol aplikasi, payload | HTTP request/response, DNS query, TLS handshake, FTP data, SMTP mail | Wireshark (HTTP/DNS/SMTP), tshark βexport-objects, Zeek http.log, dns.log | βApa yang dikirim user?β β SQL injection in HTTP, C2 beacon DNS, exfiltration via HTTP |
| Level 5 β Session & Behavior | Multi-protocol, multi-connection | Correlated sessions (5+ menit), user-agent chain, timing analysis | Zeek (conn.log + weird.log), RITA (Rare Incident Traffic Analysis), Elastic SIEM | βSiapa attacker-nya?β β C2 beacon detection, data exfiltration pattern, DDoS profile |
| β οΈ Level 6 β Threat Reconstruction & Attribution | Cross-session, cross-host, cross-time | Campaign timeline, TTP mapping, kill chain visualization | MISP, TheHive, Elastic SIEM, ATT&CK Navigator, Plaso timeline + network | βApa yang sebenarnya terjadi?β β Full intrusion reconstruction, attribution assessment |
Peta Visual β Abstraksi vs Kedalaman Insight
Kedalaman Insight β
β L6 β Threat Reconstruction βββ Attribution
β L5 β Session & Behavior ββββ C2, exfil
β L4 β Application Protocol βββββ Payload analysis
β L3 β Transport / TCP-UDP ββββ Flow analysis
β L2 β Network / IP βββ Routing, spoof
β L1 β Data Link / Ethernet ββ MAC, ARP
β L0 β Raw Wire / Physical β Signal
β ββββββββββββββββββββββββββββββββββ Abstraksi Meningkat
β
ββββββββββββββββββββββββββββββββββββ Tools Complexity
Kenapa Hirarki Ini Penting
1. Network Forensic β Endpoint Forensic
| Aspek | Endpoint Forensic | Network Forensic |
|---|---|---|
| Sumber data | Hard disk, RAM, log | PCAP, netflow, SIEM log |
| Volatilitas | Relatif stabil (kecuali RAM) | Sangat volatil β data lenyap begitu capture berhenti |
| Volume data | GBβTB per device | TBβPB per hari (enterprise) |
| Retensi | Bertahun-tahun | Biasanya 30β90 hari (sesuai kebijakan) |
| Anti-forensik | File wiping, encryption | Traffic encryption (TLS), ephemeral port, domain fronting |
| Chain of custody | Satu device fisik | Bisa ribuan device, tersebar geografis |
2. Urutan Analisis PCAP β Bottom-Up
Level 0 β 1 β 2 β 3 β 4 β 5 β 6
β β β β
Validasi Filter Flow Intent
capture noise triage analysis
Praktiknya: Jangan mulai dari Level 4 langsung. Validasi dulu integritas PCAP (L0), filter noise (L1-L2), baru analisis aplikasi (L4+).
3. Skill Progression
| Level | Skill | Waktu Belajar | CTF Relevance |
|---|---|---|---|
| L0 | Baca hex dump, pahami Ethernet frame | 1β2 jam | Jarang |
| L1βL2 | Filter IP/MAC, cari scan | 2β4 jam | Kadang |
| L3 | Flow analysis, port scan detection | 4β8 jam | Sering |
| L4 | HTTP/DNS/TLS payload extraction | 8β16 jam | β€οΈ Paling sering |
| L5 | C2 beacon, exfil pattern | 2β5 hari | Tim IR |
| L6 | Full campaign reconstruction | Mingguβbulan | Hanya live exercise |
PCAP Analysis β Universal Workflow
Step-by-Step: Dari PCAP Mentah ke Flag
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. Identifikasi PCAP (L0βL1) β
β capinfos file.pcap β durasi, packet count, size β
β tshark -r file.pcap -T fields -e frame.protocols | sort -u β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 2. Statistik Dasar (L1βL3) β
β tshark -r file.pcap -z io,stat,0.1 β
β tshark -r file.pcap -z conv,ip β
β tshark -r file.pcap -z endpoints,ip β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 3. Cari Anomali (L3βL4) β
β Banyak SYN β port scan β
β DNS TXT besar β exfiltration β
β HTTP POST ke IP β data exfil β
β TLS ke IP (bukan domain) β C2 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 4. Export Objects (L4) β
β tshark --export-objects http,output/ β
β tshark --export-objects smb,output/ β
β Wireshark: File β Export Objects β HTTP/SMB/TFTP β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 5. Follow Stream (L4) β
β tshark -r file.pcap -z follow,tcp,ascii,0 β
β Wireshark: Right-click TCP β Follow β TCP Stream β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 6. Cari Flag (L4+) β
β strings capture.pcap | grep -i "CTF\|flag" β
β tshark -r file.pcap -Y "http contains flag" β
β tshark -r file.pcap -Y "dns contains CTF" β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Tooling Matrix
| Task | CLI Tool | GUI / Alternatif |
|---|---|---|
| PCAP info | capinfos | Wireshark Statistics |
| Filter & search | tshark, tcpdump | Wireshark display filter |
| Conversation analysis | tshark -z conv,... | Wireshark Statistics β Conversations |
| HTTP extraction | tshark --export-objects http,... | File β Export Objects β HTTP |
| DNS analysis | tshark -Y dns | Zeek dns.log |
| TLS metadata | tshark -Y tls.handshake | Zeek ssl.log |
| File extraction | foremost file.pcap, binwalk -Me | NetworkMiner |
| Flow correlation | Zeek conn.log | RITA, Elastic |
Common Network Attacks & Forensic Signature
π΄ Reconnaissance & Scanning
| Teknik | PCAP Signature | Cara Deteksi |
|---|---|---|
| SYN scan | SYN β SYN-ACK β RST (tidak ever completed connection) | tshark -Y "tcp.flags.syn==1 and tcp.flags.ack==0 and tcp.flags.reset==1" |
| Full connect scan | SYN β SYN-ACK β ACK β RST | tshark -Y "tcp.flags==0x0017" (SYN+ACK, port terbuka) |
| FIN scan | FIN (bukan SYN) langsung kirim | tshark -Y "tcp.flags.fin==1 and tcp.flags.syn==0" |
| NULL scan | TCP tanpa flag | tshark -Y "tcp.flags==0" |
| Xmas scan | FIN+PSH+URG | tshark -Y "tcp.flags.fin==1 and tcp.flags.psh==1 and tcp.flags.urg==1" |
| ACK scan | ACK flood β map firewall rule | tshark -Y "tcp.flags.ack==1 and tcp.flags.syn==0" |
| UDP scan | ICMP Port Unreachable response | tshark -Y "icmp.type==3 and icmp.code==3" |
π΄ Man-in-the-Middle
| Teknik | PCAP Signature | Cara Deteksi |
|---|---|---|
| ARP spoofing | Dua MAC untuk satu IP | tshark -Y "arp" β lihat MAC ganda per IP dalam waktu singkat |
| DNS spoofing | DNS reply tanpa query, atau reply pertama dari attacker (sebelum legitimate) | Cari DNS answer yang tidak match dengan query |
| DHCP spoofing | Multiple DHCP server offering per request | tshark -Y "dhcp.option.dhcp==2" β DHCP Offer dari IP berbeda |
| STP hijack | BPDU dari port yang seharusnya bukan root | tshark -Y "stp" β lihat Root Bridge ID yang berubah |
π΄ DDoS
| Teknik | PCAP Signature | Cara Deteksi |
|---|---|---|
| SYN flood | SYN tanpa SYN-ACK β backlog penuh | tshark -Y "tcp.flags.syn==1 and tcp.flags.ack==0" + filter by source IP |
| UDP flood | UDP flood ke port random | tshark -Y "udp" + statistik source IP |
| ICMP flood | Ping flood | tshark -Y "icmp" |
| HTTP flood | GET flood dari IP berbeda | tshark -Y "http.request" + statistik user-agent |
| DNS amplification | Source IP palsu, DNS dengan EDNS0 besar | Cari DNS response size > 512 bytes dengan source IP random |
π΄ C2 & Exfiltration
| Teknik | PCAP Signature | Cara Deteksi |
|---|---|---|
| DNS tunneling | DNS TXT/AAAA query ke domain aneh, subdomain panjang (>30 char) | tshark -Y "dns.txt" β cari TXT record dengan data non-teks |
| HTTP beacon | GET periodik ke endpoint yang sama setiap N detik | Wireshark IO Graph dengan interval 1 detik β lonjakan periodik |
| HTTPS to IP | TLS handshake langsung ke IP (bukan domain) | tshark -Y "tls.handshake.type==1 and not tls.handshake.extensions_server_name" |
| ICMP tunneling | ICMP echo data berisi data biner | tshark -Y "icmp" + follow ICMP data |
| DNS exfiltration | DNS query dengan hostname mengandung data terenkripsi | Cari subdomain dengan entropy tinggi |
| HTTP POST exfiltration | POST berisi data ke endpoint tidak dikenal | tshark -Y "http.request.method==POST" β cek panjang content |
| Stego in images | Gambar diunggah ke image hosting | HTTP POST dengan Content-Type image/ β ukuran tidak wajar |
Plot Twists
Plot Twist 1: Enkripsi Membunuh Forensik Jaringan β Tapi Metadata Tetap Ada
TLS 1.3 mewajibkan enkripsi handshake β Anda tidak bisa lihat certificate atau SNI tanpa decrypt. Tapi metadata tetap terlihat: source/destination IP, port, ukuran paket, timing, dan frekuensi. Untuk C2 detection, metadata cukup. Untuk content extraction (flag dalam HTTP body) β Anda butuh decrypt key atau PCAP sebelum TLS.
Plot Twist 2: WireGuard & QUIC Membuat Identifikasi C2 Sulit
WireGuard tidak punya header protokol yang recognizable β semua paket terlihat seperti random UDP. QUIC (HTTP/3) menggabungkan handshake + data dalam satu round trip β koneksi legitimate pun susah dibedakan dari beacon. Behavior-based detection (periodicity, packet size, timing) jadi satu-satunya cara.
Plot Twist 3: Netflow/Sflow β PCAP
PCAP merekam semua data β payload, header lengkap, timing. Netflow hanya merekam metadata: src/dst IP, port, protocol, ukuran, timestamp. Netflow tidak bisa extract flag atau rekonstruksi file. Di kompetisi CTF, soal pasti pake PCAP. Di dunia nyata (enterprise), mayoritas hanya punya netflow karena ukuran PCAP terlalu besar.
Plot Twist 4: Timeline PCAP Bisa Dipalsukan
Wireshark/tcpdump mencatat timestamp dari sistem operasi. Attacker bisa:
- Inject paket dengan timestamp palsu (pcapr)
- Hapus paket dari tengah capture
- Edit PCAP header dengan
bittwistatautcprewriteMitigasi: Cek kontinuitas sequence number, cek gap timestamp, cek delta antara paket consecutive. Jika ada lompatan besar β kemungkinan PCAP telah dimodifikasi.
Plot Twist 5: Loopback & Container Traffic Tidak Tertangkap di PCAP
Jika Anda capture di eth0 β traffic antar container (bridge network) tidak muncul. Jika aplikasi client-server di localhost yang sama β traffic tidak lewat wire sama sekali. Capture harus di interface yang benar:
docker0,br-xxx,lo, atau mirror port di switch.
Sumber Data Network Forensics
| Sumber | Level | Kelebihan | Kekurangan |
|---|---|---|---|
| PCAP penuh | L0β6 | Semua data ada | Ukuran besar, butuh storage besar |
| NetFlow/IPFIX | L3β5 | Ringan, scalable | Tanpa payload, tidak bisa extract file |
| SIEM logs | L4β6 | Sudah terkorelasi, alert built-in | Tertinggal real-time, butuh tuning |
| Proxy logs | L4β5 | Semua HTTP tercatat | Hanya HTTP/HTTPS β protokol lain tidak |
| DNS logs | L4β5 | DNS query tercatat sempurna | Hanya DNS β tidak capture traffic lain |
| Zeek logs | L3β6 | Multi-protocol, metadata kaya | Butuh dedicated server |
| WAF logs | L4 | Attack payload terekam | Hanya traffic yang lewat WAF |
Cross-Link
- Tool Arsenal (Network Forensic Section) β ctf-tool-arsenal-universal
- PCAP Analysis Praktis β network-forensics-pcap-analysis
- Digital Evidence Hierarchy (OoV) β hierarchy-digital-evidence-acquisition
- CTF Methodology (Forensic Flow) β ctf-competition-methodology-strategy
- Incident Response Framework β incident-response-framework
- Endpoint Detection (Network + Endpoint) β hierarchy-endpoint-security
- Master Index β master-index
Network Forensics Hierarchy | Level 0 (Raw Wire) β Level 6 (Threat Reconstruction) Β· Metadata Tetap Ada Meski Encrypted Β· PCAP = Gold Standard Β· Netflow = Ringan Tapi Buta Payload