tshark (wireshark)笔记

简介:

1. dumpcap -i eth0 -q -n -b duration:120 -b files:5000 -s65535 -f "! ip broadcast and ! ip multicast and ! ether broadcast and ! ether multicast" -w /www/pkg.pcap
-i eth0 : 抓取网口 eth0 的数据
-q : 静默方式
-n : 禁止解析
-b duration:120 -b files:5000 : 每120s建立一个新文件,最大文件循环数5000个
-s65535 : 抓取尺寸在65535字节以下的报文。(默认68以下)
-f "! ip broadcast and ! ip multicast and ! ether broadcast and ! ether multicast" :过滤条件
-w /www/pkg.pcap : 抓到的包写入的文件

2. tshark -z ip_hosts,tree -q -r pkg.pcap
统计这个文件中出现的IP

3. tshark -z conv,ip -q -r pkg.pcap
统计这个文件中出现的IP以及这个IP的流量

4. tshark -z io,stat,2,"ip.addr==192.168.1.101" -t ad -q -r pkg.pcap
统计这个文件中IP192.168.1.101每隔2s的流量

5. tshark -z conv,tcp -q -r pkg.pcap
tshark -r pkg.pcap -T fields -e ip.src -e ip.dst -e tcp.srcport -e tcp.dstport
统计文件中出现的4元组

6. tshark -r pkg.pcap -T fields -e eth.src -e eth.dst
tshark -z conv,eth -q -r pkg.pcap
统计每个抓到的包里面出现的MAC,这个文件必须是针对某一个网卡(eth0, eth1),而不能是any

7. mergecap -w pkg.pcap pkg_00001* pkg_00002*
把所有相符的包文件都合并为一个pkg.pcap文件



本文转自郝峰波博客园博客,原文链接:http://www.cnblogs.com/fengbohello/p/4665153.html,如需转载请自行联系原作者


相关文章
|
3月前
|
网络安全 Go
Wireshark 完结篇
Wireshark 完结篇
|
应用服务中间件 nginx
wireshark抓包入门使用教程
wireshark抓包入门使用教程
759 0
wireshark抓包入门使用教程
|
3月前
|
网络协议
wireshark学习
wireshark学习
|
6月前
|
网络协议
Wireshark 抓包工具介绍
Wireshark 抓包工具介绍
63 0
|
网络协议 前端开发
wireshark抓包新手使用教程
Wireshark是非常流行的网络封包分析软件,可以截取各种网络数据包,并显示数据包详细信息。常用于开发测试过程各种问题定位。
2110 0
wireshark抓包新手使用教程
|
网络协议
Wireshark基础及使用
Wireshark-- 网络分析工具 基础及使用
Wireshark基础及使用
|
网络协议 Unix 网络安全
[工具使用]Wireshark(上)
[工具使用]Wireshark
218 0
[工具使用]Wireshark(上)