tshark解析本地pcap数据包提取五元组{src_ip,src_port,proto,dst_ip,dst_port}与时间戳,包长

tshark官方文档:https://www.wireshark.org/docs/man-pages/tshark.html
wireshark官方特征参考:https://www.wireshark.org/docs/dfref/

前提需要安装wireshark

提取五元组{src_ip,src_port,proto,dst_ip,dst_port}

代码如下:

tshark -r pcap文件 -T fields -e ip.src -e tcp.srcport -e ip.dst -e tcp.dstport -e ip.proto -E separator=, > out.csv
#-E separator=,	这个是设置分隔符为','

提取时间戳,数据包长

tshark -r pcap文件 -T fields -e ip.src -e tcp.srcport -e ip.dst -e tcp.dstport -e ip.proto -e frame.len -e frame.time_epoch -E separator=, > out.csv

其他内容请查看官方文档,官网写的还挺清楚的

猜你喜欢

转载自blog.csdn.net/weixin_35757704/article/details/107317814