首先,需要安装Wireshark。
在cygwin中抓包:
curr_time=`date '+%Y%m%d%H%M%S'`
/cygdrive/c/Program\ Files/Wireshark/dumpcap.exe -f "port 80" -w `cygpath.exe -w /cygdrive/d/wireshark/${curr_time}.pcap`
停止抓包:
taskkill /F /IM dumpcap.exe
转载于:https://blog.51cto.com/yuanhuan/1721647