
Network Forensics: วิเคราะห์หลักฐานดิจิทัลจาก Network Traffic
Network Forensics คือการจับ บันทึก และวิเคราะห์ network traffic เพื่อหาหลักฐานของการโจมตี การรั่วไหลของข้อมูล หรือกิจกรรมที่ไม่พึงประสงค์ เป็นส่วนสำคัญของ incident response และ digital forensics ช่วยตอบคำถามว่า “เกิดอะไรขึ้น เมื่อไหร่ ใคร ยังไง”
เมื่อเกิด security incident หลักฐานบน network เป็นสิ่งแรกที่หายไป ถ้าไม่ได้ capture ไว้ RAM ถูก overwrite, logs ถูกลบ แต่ network traffic ที่ capture ไว้เป็นหลักฐานที่แก้ไขไม่ได้ (immutable) บทความนี้จะสอนวิธีทำ network forensics ตั้งแต่การเก็บหลักฐานจนถึงการวิเคราะห์
Network Forensics Process
| ขั้นตอน | รายละเอียด | Tools |
|---|---|---|
| 1. Collection | จับ/รวบรวม network traffic data | tcpdump, Wireshark, TAPs, SPAN ports |
| 2. Preservation | เก็บรักษาหลักฐานให้ครบถ้วน (chain of custody) | Hash verification (MD5/SHA256) |
| 3. Examination | กรองและจัดระเบียบ data | Wireshark filters, tshark, NetworkMiner |
| 4. Analysis | วิเคราะห์หา patterns, anomalies, IOCs | Zeek, Suricata, Arkime, SIEM |
| 5. Reporting | สรุปผลการวิเคราะห์เป็นรายงาน | Timeline, IOC lists, recommendations |
Data Sources
| Source | ข้อมูลที่ได้ | ข้อดี/ข้อเสีย |
|---|---|---|
| Full Packet Capture (PCAP) | ทุก byte ของ traffic | ข้อมูลครบที่สุด แต่ใช้ storage มาก |
| NetFlow/IPFIX | Flow records (src/dst IP, port, bytes, packets) | Storage น้อย แต่ไม่มี payload |
| Firewall Logs | Allow/deny decisions, src/dst, ports | มีอยู่แล้ว แต่ข้อมูลจำกัด |
| DNS Logs | ทุก DNS query/response | สำคัญมาก (C2 detection, data exfil) |
| Proxy/Web Logs | URLs, user agents, response codes | สำหรับ web-based attacks |
| IDS/IPS Alerts | Signature-matched threats | Targeted แต่อาจ miss unknown threats |
| Zeek/Bro Logs | Parsed protocol logs (conn, http, dns, ssl) | Structured, searchable, comprehensive |
Full Packet Capture
Capture Architecture
วิธีจับ traffic: Network TAP: อุปกรณ์ passive ดัก traffic บน physical link (ดีที่สุด ไม่มี packet loss) SPAN/Mirror Port: Switch copy traffic ไป monitoring port (ง่าย แต่อาจ drop packets ถ้า overloaded) Inline Device: IDS/IPS/Firewall ที่อยู่ in-path
Storage Requirements: 1 Gbps link @ 50% utilization = ~5.4 TB/day 10 Gbps link @ 30% utilization = ~32.4 TB/day ต้องมี high-speed storage (NVMe SSD arrays) retention policy: เก็บ 7-30 วัน (ขึ้นกับ budget)
Common Attack Patterns
| Attack | Network Indicators | วิธีตรวจจับ |
|---|---|---|
| C2 (Command & Control) | Periodic beaconing, DNS tunneling, unusual ports | Zeek conn logs (duration, bytes), DNS query patterns |
| Data Exfiltration | Large outbound transfers, DNS tunneling, HTTPS to unknown | NetFlow (bytes out), DNS query length, SSL cert analysis |
| Lateral Movement | SMB/RDP/WMI between workstations, unusual src→dst pairs | Zeek conn logs, unusual internal traffic patterns |
| Brute Force | Many failed login attempts from same source | Authentication logs, connection counts |
| DDoS | Traffic spike, many src IPs, SYN floods | NetFlow volume, SYN/ACK ratio |
| Malware Download | HTTP GET to suspicious URL, unusual file types | HTTP logs, file extraction, hash matching |
Network Forensics Tools
| Tool | ประเภท | จุดเด่น |
|---|---|---|
| Wireshark | Packet analyzer | Deep packet inspection, protocol decode |
| tshark | CLI packet analyzer | Scripting, automation, large pcaps |
| NetworkMiner | Forensic analyzer | Extract files, images, credentials from pcap |
| Zeek (Bro) | Network security monitor | Structured logs, protocol analysis |
| Arkime (Moloch) | Full packet capture + search | Large-scale PCAP storage + search |
| Suricata | IDS/IPS + NSM | Signature + protocol detection |
| RITA | Beacon detection | Find C2 beaconing in Zeek logs |
| Volatility + bulk_extractor | Memory + network artifacts | Extract network data from memory dumps |
Investigation Workflow
เมื่อเกิด Incident
1. Scope: ระบุ timeframe ของ incident (เริ่มเมื่อไหร่ ถึงเมื่อไหร่) ระบุ affected systems (IP addresses, hostnames)
2. Extract: ดึง PCAP/logs ในช่วงเวลาที่เกี่ยวข้อง Hash ทุก evidence files (SHA256) สำหรับ chain of custody
3. Analyze: Timeline: สร้าง timeline ของ events Connections: ดู unusual connections (internal → external, lateral) DNS: ดู suspicious queries (DGA, tunneling) Files: Extract files จาก pcap (NetworkMiner) Credentials: ดู cleartext credentials (HTTP basic, FTP, telnet)
4. Correlate: รวม network evidence กับ host logs, endpoint data สร้าง attack timeline ที่สมบูรณ์ ระบุ IOCs (Indicators of Compromise)
Chain of Custody
| Step | Action |
|---|---|
| Capture | บันทึกว่าจับ traffic จากไหน เมื่อไหร่ ใคร |
| Hash | SHA256 hash ของทุก pcap file ทันทีหลัง capture |
| Store | เก็บ original ใน read-only storage วิเคราะห์จาก copy |
| Document | บันทึกทุก action ที่ทำกับ evidence (who, what, when) |
| Report | สรุปผลพร้อม hash verification |
ทิ้งท้าย: Capture Now, Analyze Later
Network Forensics ต้องเตรียมตัวล่วงหน้า ถ้าไม่ capture traffic ไว้ จะไม่มี evidence เมื่อเกิด incident ติดตั้ง full packet capture หรือ Zeek/Suricata เก็บ DNS logs และ NetFlow ทุกอย่าง ฝึกทีม IR ให้คุ้นเคยกับ tools ก่อนเกิดเหตุ
อ่านเพิ่มเติมเกี่ยวกับ Wireshark Packet Analysis และ DNS Security ที่ siamlancard.com หรือจาก icafeforex.com และ siam2r.com