指令 Microsoft OS 封包監視器(Pktmon)
伴隨著 網路虛擬化 的衍伸出現,網路堆疊技術 的大小也會乘以…
當您需要使用 封包檢測 “來源 和 目的” 時候…
..ก็ʕ•͡ᴥ•ʔ ก้ ..
在微軟 Windows 10 和 WindowsServer 2019(1809)版本之後
所提供 系統內建一個命令列封包監聽工具 (Pktmon)
搭配 Wireshark 封包搜集 (pcapng 格式) 支援
.
.
[ Pktmon 相對應命令 ]
開啟 命令提示字元 (系統管理員)
輸入 pktmon.exe
filter —manage packet filters
comp –manage registered components
reset —reset packet counters
start –start packet monitoring
stop —stop packet monitoring
format –convert the traffic log file to a text format
pcapng –convert to the pcapng format
unload –unload the PktMon driver
如同 netsh trace 命令字元 用於捕獲 網絡流量 並進行檢查數據包
.
.
[ 嘗試 收集設備上未知正在運行的服務流量 ]
假設分析 FTP(TCP 20,21)和 HTTP(TCP 80,443) Port Number
並為 TCP 端口 創建一個數據包過濾器(也可以追蹤 UDP 和 ICMP 流量)
輸入 pktmon filter add -p 20 21
輸入 pktmon filter add HTTPFilter –p 80 443
[ 顯示活動過濾器列表 ]
pktmon filter list
.
.
[ 範例 測試一個 ICMP 的過濾器指令搜集 (透過 PING 外部方式) ]
輸入 pktmon filter add ping -t icmp
輸入 pktmon start –etw -p 0
開啟 cmd
輸入 Ping 8.8.8.8 or 8.8.4.4 (測試Google 所提供 DNS 外部服務器)
輸入 pktmon stop
開啟 C:\根目錄資料夾 確認產生 PktMon.etl 文件
.
.
[ 使用 Pktmon 指令 (etl 轉換成 txt 格式) ]
輸入 pktmon format PktMon.etl -o PacketLog.txt
.
.
ヽ(✿゚▽゚)ノ
支援 Micrsoft 系統環境
https://docs.microsoft.com/zh-tw/windows-server/networking/technologies/pktmon/pktmon
ヽ(✿゚▽゚)ノ
參考 Microsoft Message Analyzer (檢視 etl 格式的工具)
https://docs.microsoft.com/zh-tw/windows/iot-core/manage-your-device/networkpacketcapture