wireshark错误包显示和隐藏

wireshark抓取的网络包经过分析后,会根据每个数据包的信息进行分类(分级),并给出颜色。
对于错误包会使用黑底红字重点突出出来,如下图所示:


我们知道TCP连接是可靠的,那么换句话说,这些错误信息基本都是已经"修复"了的,即我们可以忽略。那么,如何在wireshark中隐藏这些错误包呢?当然,如果需要分析这些错误包,那么如何过滤出所有的错误包呢?
PS:这里的"修复"是有限的,同样,对于分析协议时站得角度和层次不同,这些错误包可能就是致命错误,此处只是针对如何隐藏和显示特定数据包加以说明,没有对协议过多分析。

一、数据包信息级别

7.3.1.1. Severity
Every expert info has a specific severity level. The following severity levels are used, in parentheses are the colors in which the items will be marked in the GUI:

Chat (grey): information about usual workflow, e.g. a TCP packet with the SYN flag set
Note (cyan): notable things, e.g. an application returned an "usual" error code like HTTP 404
Warn (yellow): warning, e.g. application returned an "unusual" error code like a connection problem
Error (red): serious problem, e.g. [Malformed Packet]
------------------------------------以上信息来自于Wireshark User's Guide-------------------------------------

不同的错误包表示不同的错误级别:会话、提示、警告以及错误。当然,Chat级别的数据包肯定不是错误,Note级别的错误包表示数据虽然合法但是可能不是我们预期数据,Warn级别和Error级别很明显就是错误数据了,需要特殊加以注意和分析。

二、过滤指定的数据包

查找wireshark-filter的帮助文档「Help -> Manual Pages -> Wireshark Filter」: file:///C:/Program%20Files%20%28x86%29/Wireshark/wireshark-filter.html
关于Expert Info的共有下述三个过滤条件:
Expert Info (expert)

    expert.group  Group
        Unsigned 32-bit integer
        Wireshark expert group

    expert.message  Message
        String
        Wireshark expert information

    expert.severity  Severity level
        Unsigned 32-bit integer
        Wireshark expert severity level
这里的"Unsigned 32-bit integer",肯定不能随意的填写0,1,2之类的数值「实际测试,使用0,1,2确实不能过滤出来数据」。在Wireshark User's Guide中,已经告诉我们正确的Severity level取值范围是{Chat, Note, Warn, Error}

经过测试,使用expert.severity==Note、expert.severity==Warn均能过滤出一些数据。

三、隐藏所有的错误包

继续查看Wireshark User's Guide,《6.4. Building display filter expressions》

Table 6.4. Display Filter comparison operators

English C-like Description and example
eq
=

Equal

ip.src==10.0.0.5
ne
!=

Not equal

ip.src!=10.0.0.5
gt
>

Greater than

frame.len > 10
lt
<

Less than

frame.len < 128
ge
>=

Greater than or equal to

frame.len ge 0x100
le
<=

Less than or equal to

frame.len <= 0x20

因此,所有的错误数据包,可以使用 expert.severity >= Noteexpert.severity > Chat来过滤。

Table 6.6. Display Filter Logical Operations

English C-like Description and example
and &&

Logical AND

ip.src==10.0.0.5 and tcp.flags.fin
or ||

Logical OR

ip.scr==10.0.0.5 or ip.src==192.1.1.1
xor ^^

Logical XOR

tr.dst[0:3] == 0.6.29 xor tr.src[0:3] == 0.6.29
not !

Logical NOT

not llc

结合逻辑运算符not,表示逻辑反,即如果不显示所有的错误数据包,则可以使用 not expert.severity > Chat来过滤。

你可能感兴趣的:(wireshark错误包显示和隐藏)