wireshark 过滤器
wireshark有2个非常实用的过滤器。
- 用于减少记录数量的
捕获过滤器
。 - 用于强大分析的
显示过滤器
。
捕获过滤器 capture filter
语法
<Protocol> <Direction> <Host(s)> <Value> <Logical Operations> <Other expression>
protocol 协议
ether, ip, arp, icmp, tcp, udp, ...等
如果没指明协议类型,则默认为捕捉所有支持的协议。
direction 方向
src, dst, src and dst, src or dst, ...等
如果没指明方向,则默认为 src or dst
。
host 目标
net, port, host, portrange, ...等
默认为 host
。即默认下 src 192.168.0.100
等同于 host src 192.168.0.100
。
logical operations 逻辑运算符
not, and, or, ...等
not
具有最高的优先级。and
和 or
优先级相同,运算时从左至右进行。
因为 not
的优先级高于 and
和 or
,所以当要表达 not
时需要写成 and not
。
e.g.
host 192.168.0.100 and tcp and not icmp
显示过滤器 capture filter
protocol 协议
ip, tcp, udp, ssh, ...等
direction 方向
src, dst, ...等
host 目标
port, addr, flags, ...等
e.g.
src.port==80
dst.addr==192.168.0.100
operations 操作符
比较操作符
==, !=, >, <, >=, <=
e.g.
ip.addr==192.168.0.100
frame.len<=100
逻辑操作符
两种写法都可以。
and, or, xor, not
&&, ||, ``, !
e.g.
ip.addr==192.168.0.100 or ip.addr==192.168.0.200
参考
更为多的细节也可以参考软件自身。在 应用显示过滤器...<ctrl-/>
输入框边上有个 表达式...
的按钮。点进去,里面个个都是人才 :)