tshark的简单用法参考:tshark解析本地pcap数据包提取五元组{src_ip,src_port,proto,dst_ip,dst_port}与时间戳,包长
详细用法:官方DOC
-
比如提取一个数据包 my.pcap 中全部带有TLS加密的包:
tshark -r my.pcap -T fields -Y tls -e ip.src -e ip.dst -E separator=, > get_tls_pcap.csv
其中 -Y tls
表示只提取TLS协议的数据包
-
获得TLS的一些信息:
自行修改-e 你想要的信息
,这些都会被写入到指定的文件中;而-Y
会筛选数据包:
-e tls.handshake.extensions_ec_point_formats # 比如得到握手阶段的ec_point_formats
-e tls.handshake.version # 获得 TLS 版本
-Y tls.handshake.type==1 # 筛选client hello的数据包