1 过滤器
语法说明:
类型Type: host net port
方向Dir: src dst
协议: ether ip tcp udp http ftp
逻辑运算符:&&与,|| 或,!或
src host 192.168.1.1 && dst port 80 抓取源地址为192.168.1.1,目的端口为80端口的流量。
host 192.168.1.1|| host 192.168.1.2 抓取192.168.1.1和192.168.1.2的流量。
!broadcast 不要抓取广播包。
案例:
过滤MAC地址案例
ether host 00:88:ca:86:f8:0d
ether src host 00:88ca:86:f8:0d
ether dst host 00:88ca:86:f8:0d
过滤IP地址案例
host 192.168.1.1
src host 192.168.1.1
dst host 192.168.1.1
过滤端口案例
port 80
!port 80
dst port 80
src port 80
过滤协议案例
arp
icmp
综合过滤案例
host 192.168.1.100 && port 8080
capture Options -》Capture Filter中输入
2 显示过滤器
过滤IP地址案例
ip.addr 192.168.1.1
ip.src192.168.1.1
ip.dst192.168.1.1
ip.src192.168.1.100 and ip.dst==58.250.135.156
过滤端口案例
tcp.port80
tcp.dstport80
tcp.src80
tcp.flag.syn1(可用于测试三次捂手的情况。)
过滤协议案例
arp
tcp
udp
not http
综合过滤案例
ip.src192.168.1.100 and tcp.dstport80
ip.addr192.168.1.106 and udp.port4000
ngrep抓包
ngrep -W byline -d ens192 |grep /iqc-pc/user/getUserInfo -C 20