Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบ >> Windows

วิธีใช้ Network Sniffer Tool PktMon.exe ใหม่ใน Windows 10

Windows 10 มี Network Sniffer Tool ตัวของตัว — PktMon.exe — ตรวจสอบ Packet Propagation และ Packet Drop Reports ช่วยสืบสวน Network Latency ระบุแอปที่ได้รับผลกระทบ ร่วม Tool อื่นได้ Metrics สำคัญ บทความนี้สอนใช้ PktMon.exe

Network Sniffer Tool PktMon.exe ใน Windows 10

PktMon.exe หรือ Packet Monitor เครื่องมือ Network Diagnostic และ Packet Monitoring ใหม่ อยู่ใน Systems Folder เรียกได้จาก Run, CMD, PowerShell

คล้าย Netsh Trace Command ที่ Enable/Configure Network Tracing ตอน Troubleshoot Network Connectivity

วิธีใช้ Network Sniffer Tool PktMon.exe ใหม่ใน Windows 10

PktMon ทำอะไรได้บ้าง

รัน PktMon.exe Help ใน CMD จะได้:

  • filter: จัดการ Packet Filters
  • comp: จัดการ Registered Components
  • reset: รีเซ็ต Counter
  • start: เริ่ม Monitor Packet
  • stop: หยุด Monitor
  • format: แปลง Log File เป็น Text
  • unload: Unload PktMon Driver

Help คำสั่งเฉพาะ: pktmon filter help

pktmon filter { list | add | remove } [OPTIONS | help]

Commands:
  list   Display active packet filters
  add    Add a filter to control which packets are reported
  remove Removes all filters

PktMon รองรับ Real-time Monitoring และ PCAPNG File Format

อ่านเพิ่ม: วิธี Enable และ Test DNS over HTTPS ใน Windows 10

วิธีใช้ PktMon ตรวจสอบ Network Traffic

ตัวอย่างง่าย:

  1. สร้าง Filter ตรวจสอบ Port
  2. เริ่ม Monitoring
  3. Export Log อ่านได้

สมมติต้องการ Monitor TCP Port 1088 (Port ของ Custom App ที่ Crash PktMon ช่วยเช็ค Network)

1. สร้าง Filter

Option filter สร้าง Filter ควบคุม Packet ที่รายงาน โดย Ethernet Frame, IP Header, TCP Header, Encapsulation รัน pktmon filter add help ดูรายละเอียด

สร้าง Filter สำหรับ TCP Port 1088:

pktmon filter add -p 1088

รัน pktmon filter list ดู Filter ที่เพิ่ม

วิธีใช้ Network Sniffer Tool PktMon.exe ใหม่ใน Windows 10

ลบ Filter ทั้งหมด: pktmon filter remove

2. เริ่ม Monitoring

ไม่ใช่ Auto Background ต้อง Start เอง รัน:

pktmon start --etw -p 0

เริ่ม Monitor สร้าง Log File ที่บอกมา ต้อง Stop ด้วย stop หรือจะหยุดตอน Shutdown -p 0 Capture แค่ 128 Bytes/Packet

Log filename: C:\Windows\system32\PktMon.etl
Logging mode: Circular
Maximum file size: 512 MB

3. Export Log อ่านได้

วิธีใช้ Network Sniffer Tool PktMon.exe ใหม่ใน Windows 10

Log เก็บใน PktMon.ETL แปลงเป็น Text:

pktmon format PktMon.etl -o port-monitor-1088.txt

เปิดใน Notepad อ่านเข้าใจยาก ต้องใช้ Microsoft Network Monitor อ่าน ETL โดยตรง

Microsoft คาดจะเพิ่ม Real-time Monitoring ใน Windows 10 2004 แต่ยังไม่เห็น

อ่านเพิ่ม: Free Packet Sniffing Tools for Windows 10

วิธีใช้ Network Sniffer Tool PktMon.exe ใหม่ใน Windows 10