前言
最近需要写一个抓包分析的脚本,用于抓包分析的图形化有wireshark、snort等,命令行有tshark、tcpdump、dumpcap,tshark为wireshark的命令行模式,由于对wireshark相对熟悉,以及对于其比较满意,所以最终选择tshark。
正题
首先看下用法tshark [ -2 ] [ -a <capture autostop condition> ] ... [ -b <capture ring buffer option>] ... [ -B <capture buffer size> ] [ -c <capture packet count> ] [ -C <configuration profile> ][ -d <layer type>==<selector>,<decode-as protocol> ] [ -D ] [ -e <field> ] [ -E <field print option> ] [ -f &l