tcpdump

tcpdump
tcpdump - dump traffic on a network
参数的分类:
协议 tcp udp arp icmp
数据内容 端口,Ip :
src port 80 --源
dst port 22 --目标
tcpdump tcp dst port 80 -n
tcpdump -i eth1 tcp dst port 80 -n --小写i参数指定哪个网卡
tcpdump tcp dst port 80 -n -w tcpdump.txt --把dump出来的信息保存到tcpdump.txt文件
tcpdump -r tcpdump.txt --然后需要使用tcpdump -r去读取
关系参数 : ! and or
tcpdump tcp dst port 80 -n and src 10.2.2.4
tcpdump tcp dst port 80 -n and ! src 10.2.2.4
tcpdump tcp dst port 80 -n and host 10.2.2.4
-vv <---把数据包的详细内容都记录下来
-w <---把数据保存到某个文件
======================================================================
练习:
捕捉所有访问本机ftp服务器的连接,并且数据包是来自10.2.2.4
tcpdump tcp dst port 21 and src 10.2.2.4 -n
捕捉所有来自10.2.2.1的arp协议的数据包,并且捕捉的显示要求输出以太网数据帧的信息 -e
tcpdump arp and src 10.2.2.1 -n -e
捕捉所有本机web服务回应10.2.2.4的数据包
tcpdump tcp src port 80 and dst 10.2.2.4
图形的抓包工具:wireshark
yum install wireshark*
原文地址:https://www.cnblogs.com/skyzy/p/9201303.html