tcpdump使用
tcpdump命令使用详情如下:
1.tcpdump -i eth0 src host 192.168.26.159 and dst host 192.168.26.244
抓取eth0接口,源IP主机为192.168.26.159,目的主机为:192.168.26.244
在192.168.26.159客户端发送:curl http://192.168.26.244/web/ ;抓包结果如下。
2、tcpdump host 192.168.26.244
host ip指明一台主机
3、tcpdump net 192.168.26.244
指明一个网络地址,抓包结果与host相同
4、tcpdump port 80
抓取端口号
5、tcpdump -i eth1 src 192.168.26.244
抓取接口为eth1源ip地址为192.168.26.244
6、tcpdump -i eth1 dst net 192.168.26.244
7、tcpdump -i eth1
抓取eth1的接口,如果不指定网络接口,默认为eth0;
8、tcpdump -i eth1 host 192.168.26.159 and 192.168.26.244 or 192.168.26.210
抓取网络接口为:eth1 主机192.168.26.159和192.168.26.244或者192.168.26.210之间的通信
9、抓取主机192.168.26.159发送的所有数据
tcpdump -i eth1 src host 192.168.26.159
10、tcpdump -i eth1 dst net 192.168.26.244
抓取主机192.168.26.244接收到的所有数据
11、 tcpdump -i eth1 host 192.168.26.244 and tcp port 80
抓取主机192.168.26.244所有在tcp 80的所有数据包
12、tcpdump -i eth1 host 192.168.26.244 and dst port 80
抓取主机192.168.26.244在80端口接收到的所有数据包