Snooping (สนูปปิ้ง) ใน Network Security คืออะไร?
**Snooping (Sniffing / Eavesdropping)** หมายถึง **การแอบฟัง/แอบอ่านข้อมูล** ที่ส่งผ่านเครือข่าย **โดยไม่ได้รับอนุญาต** — ผู้โจมตีจับแพ็กเก็ต (Packet Capture) เพื่อดูข้อมูล nhạy cảm เช่น **Username, Password, Session Token, Email, File Transfer, Database Query**
Snooping vs Spoofing — ต่างกันอย่างไร?
| คุณสมบัติ | Snooping (Sniffing/Passive) | Spoofing (Active) |
| ลักษณะ | Passive Attack (แอบฟังอย่างเดียว ไม่แก้ไขข้อมูล) | Active Attack (ปลอมแปลง/สร้างข้อมูลปลอม) |
| เป้าหมาย | ขโมยข้อมูล (Credentials, Data, Secrets) | ปลอมตัวตน (IP, MAC, Email, DNS, ARP) เพื่อหลอกระบบ |
| การตรวจจับ | ยากมาก (ไม่สร้าง Traffic ใหม่) | ง่ายกว่า (มี Traffic ผิดปกติ/ซ้ำ) |
| ตัวอย่าง | Wireshark, tcpdump, Ettercap (Passive Mode) | ARP Spoofing, DNS Spoofing, IP Spoofing, Email Spoofing |
| การป้องกัน | Encryption (TLS, SSH, IPsec, WPA3) | Cryptographic Auth, Port Security, DAI, RA Guard |
ประเภทของ Snooping
1. Passive Sniffing (Hub / Wireless / SPAN Port)
- Hub: ทุกพอร์ตได้รับ Traffic ทั้งหมด (โบราณ ไม่ค่อยมีแล้ว)
- Wi-Fi: **Monitor Mode** + **Aircrack-ng / Kismet / Wireshark** จับแพ็กเก็ตในอากาศได้
- Switch SPAN/RSPAN/ERSPAN: Mirror Traffic ไปยัง Sensor/Analyzer
2. Active Sniffing (บน Switched Network)
- Switch ส่งเฉพาะพอร์ตปลายทาง (MAC Address Table) → ต้อง **หลอก Switch** ให้ส่ง Traffic มาที่โจมตี
- ARP Spoofing / ARP Poisoning: ส่ง Gratuitous ARP บอกว่า "IP ของ Gateway = MAC ของโจมตี" → Traffic ไปทางโจมตี
- MAC Flooding: ส่ง MAC Address ใหม่เยอะๆ จน MAC Table เต็ม → Switch Fail-open → กลายเป็น Hub
- DHCP Spoofing / Rogue DHCP: ตั้งค่า Gateway/DNS ของเหยื่อเป็น IP ของโจมตี
- DNS Spoofing: ตอบ DNS Query ผิด → นำไปยัง Fake Server
เครื่องมือ Snooping/Sniffing ยอดนิยม
| Tool | Platform | คุณสมบัติ |
| Wireshark | Cross-platform | GUI, Deep Packet Inspection, Dissectors, Filters, Statistics — มาตรฐานอุตสาหกรรม |
| tcpdump | Linux/Unix | CLI, Lightweight, Scriptable, Capture File (.pcap) |
| Ettercap | Linux | MITM Suite: ARP Poisoning, DNS Spoofing, Password Sniffing, Filter |
| Bettercap | Cross-platform | Modern MITM Framework: BLE, Wi-Fi, IPv4/6, HSTS Bypass, Proxy Modules |
| Kismet | Linux/macOS | Wi-Fi Wardriving, Sniffing, IDS, GPS Mapping |
| Cain & Abel | Windows (Old) | ARP Poison, Password Sniff, VoIP, Wireless (Legacy) |
| NetworkMiner | Windows/Linux | Passive Network Forensics: Files, Credentials, Images, Parameters from PCAP |
ข้อมูลที่ Snooping ได้ (ถ้าไม่เข้ารหัส)
- 🔑 **Credentials:** HTTP Basic Auth, FTP, Telnet, POP3/IMAP/SMTP (Plain), SNMP v1/v2c Community String
- 🍪 **Session Cookies / Tokens:** HTTP Session Hijacking (Sidejacking)
- 📧 **Email Content:** SMTP/IMAP/POP3 ไม่เข้ารหัส
- 📁 **File Transfers:** FTP, TFTP, HTTP File Upload/Download
- 🗄️ **Database Queries:** TDS (SQL Server), MySQL Protocol, PostgreSQL Protocol (Plaintext)
- 🌐 **Web Traffic:** HTTP URLs, Parameters, Form Data, Headers
- 💬 **Chat/VoIP:** SIP/RTP (ถ้าไม่ SRTP), XMPP (Plain)
การป้องกัน Snooping (Anti-Sniffing Measures)
1. Encryption Everywhere (สำคัญที่สุด)
- TLS 1.2/1.3: HTTPS, SMTPS, IMAPS, POP3S, LDAPS, FTPS, MQTTS
- SSH: แทน Telnet, RSH, Rlogin
- IPsec / WireGuard / VPN: Site-to-Site, Remote Access
- WPA3 / WPA2-AES: Wi-Fi Encryption (CCMP/GCMP)
- Macsec (802.1AE): Link-layer Encryption สำหรับ Ethernet
2. Network Hardening
- Port Security / Sticky MAC: จำกัด MAC ต่อ Port, Violation Action: Shutdown
- Dynamic ARP Inspection (DAI): Validate ARP Packets vs DHCP Snooping Binding
- DHCP Snooping: Trusted/Untrusted Ports, Rate Limiting, Binding Database
- IP Source Guard: ป้องกัน IP Spoofing บน Untrusted Ports
- Private VLAN / Port Isolation: แยก Port ใน VLAN เดียวกันไม่ให้คุยกัน
- Disable Unused Ports / Shutdown
3. Wireless Security
- WPA3-SAE / WPA2-Enterprise (802.1X): ไม่ใช้ PSK แบบร่วมกัน
- PMF (Protected Management Frames / 802.11w): ป้องกัน Deauth/Disassoc Attack
- Disable WPS, UPnP, WMM
- Enterprise: EAP-TLS (Certificate) > PEAP-MSCHAPv2 > TTLS-PAP
4. Detection
- Promiscuous Mode Detection: `arpwatch`, `anti-sniff`, `sniffdet` (Legacy, ไม่เชื่อถือได้ 100%)
- NDR (Network Detection & Response): ExtraHop, Vectra, Corelight — Detect ARP Spoof, Unusual Traffic Patterns
- Wireless IDS/IPS (WIPS): Detect Rogue AP, Deauth Flood, Monitor Mode Clients
Snooping ใน Wireless (Wi-Fi) — จุดอ่อนพิเศษ
- Wi-Fi เป็น **Shared Medium** — ใครก็ตามในระยะสัญญาณจับแพ็กเก็ตได้ (Monitor Mode)
- WPA2-Personal (PSK): ใครมี PSK ก็จับ Handshake (4-way) → Crack Offline (Hashcat) → ได้ PSK → ถอดรหัส Traffic ทุกคน
- WPA3-SAE: **Forward Secrecy** — แม้ PSK รั่ว ก็ไม่ถอดรหัส Traffic เก่าได้
- WPA2/WPA3-Enterprise: **Per-session Keys** — ผู้ใช้แต่ละคนมี Key แยกกัน ไม่ถอดรหัสคนอื่นได้
Legal & Ethical Note
⚠️ **Snooping/Sniffing เครือข่ายของผู้อื่นโดยไม่ได้รับอนุญาต = ผิดกฎหมาย** (Computer Crime Act Thailand, CFAA US, GDPR, PDPA) — ใช้ได้เฉพาะ:
- Lab/Environment ของตัวเอง
- การทำ Penetration Testing ที่มี **Scope และ Permission เขียนลงสัญญา (Rules of Engagement)**
- การ Troubleshooting เครือข่ายขององค์กรตัวเอง (Admin Authorized)
สรุป
Snooping = **Passive Eavesdropping** — อันตรายเพราะ "เงียบ ไม่เห็นง่าย" การป้องกันที่ดีที่สุดคือ **Encrypt Everything (TLS, SSH, IPsec, WPA3, Macsec)** + **Network Hardening (DAI, DHCP Snooping, Port Security)** + **Detection (NDR, WIPS)** — และ **ไม่ใช้ Protocol แบบ Plaintext (HTTP, FTP, Telnet, SNMPv1/v2c) ใน Production แล้วนะครับ**