官术网_书友最值得收藏!

Wireshark display filters

Wireshark provides a very wide range of protocol-specific display filters that can be extremely useful for analysis activities by allowing you to focus on specific packets, based on criteria that you define. You can filter on just the traffic that you want to see or filter undesired traffic out of view. Display filters are one of the most helpful features of Wireshark, so they warrant becoming very familiar with.

Display filters can be created in several ways:

  • By applying display filters from the Display Filter window
  • By typing in the display filter syntax (using autocomplete)
  • By applying display filters from the Conversations (or Endpoints) window
  • By applying saved display filters from Filter Expression Buttons
  • Using the Expressions button for assistance creating filters
  • Using right-click menus on specific packet fields
    Note

    Remember that display filters use a proprietary Wireshark filter format, which is protocol-dependent and significantly different from capture filter syntax.

The Display Filter window

You can open the Display Filter window by selecting Display Filters from the Analyze menu, by clicking on the Edit/apply display filter icon on the icon bar, or by just clicking the Filters button next to the display filter textbox on the display filter bar.

The Display Filter window looks and functions in a similar fashion to the capture filters window, as shown in the following screenshot. You can create a new custom display filter to be added to this window by entering a filter name and the appropriate syntax and clicking on New or clicking an existing filter. Click on New and modify/rename as per your requirements.

Display filters listed in this window were saved in a dfilters file in the Wireshark installation directory for the default profile and in the appropriate Personal configuration directory when custom profiles are in use.

When you apply a display filter, the Status Bar at the bottom of the Wireshark user interface screen reflects the total number of packets and the packets displayed, as illustrated in the following screenshot:

The display filter syntax

The default selection of capture filters from the Display Filter window shown previously provides examples of basic capture filter syntax. Additional examples of display filter syntax are outlined in the following table:

Note

Using the != operator on expressions such as eth.addr, ip.addr, tcp.port, and udp.port and alike may not work as expected as there are usually two addresses and ports in a packet, and the ! operator will not match both instances.

Use !(ip.addr == x.x.x.x) or a similar syntax for these types of filters.

More information and examples of display filters can be found on the Wireshark wiki at http://wiki.wireshark.org/DisplayFilters and protocol-specific display filter syntax is included in the reference information found at http://wiki.wireshark.org/ProtocolReference.

Typing in a display filter

You can type a display filter syntax directly into the Filter textbox in the display filter bar, and then click on Apply to apply the filter or Clear to clear a filter and start over.

A helpful feature of typing the display filter syntax into the textbox is the autocomplete function. Upon typing a protocol and then a period (.), the textbox will display a list of available protocol-related extensions that can be selected and then the appropriate comparison operator and value added before clicking on Apply.

The textbox also has a color-coded background indicating the display filter syntax status. If the syntax is incorrect or incomplete, the background is red and a correct filter results in a green background. A yellow background is a warning that the entered syntax may not work as expected.

Display filters from a Conversations or Endpoints window

Creating a display filter to be applied from a Conversations window has already been covered. The same functionality is available from an Endpoints window, which can be opened by selecting Endpoint List from the Statistics menu and one of the listed protocols.

主站蜘蛛池模板: 黄陵县| 乌什县| 常州市| 古浪县| 延庆县| 蒙阴县| 买车| 梅河口市| 东乌| 台北市| 易门县| 井研县| 华亭县| 平果县| 沂源县| 荣成市| 正蓝旗| 黎城县| 密云县| 舟曲县| 临澧县| 隆尧县| 察哈| 德江县| 桂东县| 耒阳市| 大洼县| 安岳县| 苗栗县| 盐城市| 尼玛县| 西平县| 大连市| 兴宁市| 乡宁县| 若尔盖县| 大厂| 如东县| 桃源县| 遂溪县| 永康市|