关键字
and
表示 并且or
表示 或者!
表示 取反eq
和==
等同
多组条件联合过滤数据包的命令,就是通过每个单个的条件命令与关键字“与或非”的组合实现的。
针对 IP 的过滤
-
针对源地址为 192.168.20.72 的包
ip.src==192.168.20.72
-
针对目的地址为 192.168.20.72 的包
ip.dst==192.168.20.72
-
对源地址或目的地址为 192.168.20.72 的包
ip.addr==192.168.20.72
等价为:
ip.src==192.168.20.72 or ip.dst==192.168.20.72
-
如果要排除以上情况,只需要将其用括号包围,前边加一个
!
!(表达式)
针对 协议 的过滤
-
仅捕获某种协议的数据包只需要把协议名字输入即可
http
注: 只能用小写
-
捕获多种协议的数据包
http or telnet
-
排除某种协议的数据包
not arp
等价为:
!arp
针对 端口 的过滤
-
捕获某一端口的数据包
tcp.port==80
-
捕获高于某端口的数据包
tcp.port>=500
针对 数据段长度 的过滤
udp.length < 30
tcp.len > 10
http.content_length <= 20
针对 数据包内容 的过滤
-
http 响应中包含 “Remote” 的包
http contains "Remote"
参考链接: https://blog.csdn.net/quincyfang/article/details/56670181
参考链接:https://blog.csdn.net/aflyeaglenku/article/details/50884296