這是歷史版本頁面 — 看 Wireshark (64-bit) 最新版本

網路卡頓找不到原因?Wireshark 抓封包看真相

Wireshark (64-bit) 軟體圖示 Wireshark (64-bit) 4.0.0 (64-bit) 資料更新 2022-10-05 閱讀約 6 分鐘

網路變慢、連線不穩、某個服務突然連不上,你第一個念頭是重開機、重插網路線,但問題還是反覆出現。你想知道到底是哪個環節出錯,是 DNS 沒回應、TCP 一直重傳,還是某支程式在背景偷傳資料,卻只能看著工作管理員的百分比猜。這種時候,你需要的是把網路上實際在跑的封包一層一層拆開來看。

一般人習慣先 ping 看看、開網頁測速,這些工具只能告訴你「通不通」「快不快」,無法告訴你「到底發生什麼事」。封包分析工具的切入點,是把你電腦進出的每一筆網路流量記錄下來,再用你能讀懂的方式呈現,讓你可以沿著封包內容去追問題的源頭。它不是拿來測速的,是拿來「看內容」的。

01Wireshark 到底能拿來做什麼?

它是一套網路封包分析工具,可以即時擷取電腦網路介面卡進出的流量,也可以讀取先前存下來的封包檔做離線分析。常見用途包含:找出連線緩慢或中斷的原因、確認某個協定是否正常運作、檢查是否有異常流量,以及作為學習網路協定的教材。它會把封包內容解碼成人類可讀的格式,例如 HTTP、DNS、TCP 等,方便你逐層檢視。

02抓了一堆封包,密密麻麻的看不懂怎麼辦?

這是剛開始最常遇到的障礙。它提供顯示過濾器,你可以輸入條件,例如只顯示某個 IP 位址、某個通訊埠或某種協定的封包,把不相關的流量暫時隱藏。介面本身是英文的,但過濾語法不難學,常見的像是 `ip.addr == 192.168.1.1` 或 `tcp.port == 443`。先從過濾單一協定開始,會比直接看全部流量容易上手。

03可以抓無線網路的封包嗎?

可以,但有限制。它支援從無線網路介面卡擷取封包,前提是你的無線網卡和驅動程式必須支援監聽模式,否則只能抓到自己的電腦進出的流量,無法看到網路上其他裝置的封包。如果你只是想分析自己這台電腦的連線問題,一般無線網卡就夠用;但若是要分析整個無線網路的流量,需要額外確認硬體是否支援。

04抓到的封包如果是加密的,還能看到內容嗎?

它可以把加密的流量完整記錄下來,但內容是亂碼,無法直接閱讀。除非你擁有加密金鑰,例如 SSL/TLS 的私鑰,才能夠在軟體中設定金鑰來解密。WPA/WPA2 的無線網路加密,也需要知道密碼才能解密。換句話說,它能告訴你「有加密流量在跑」,但看不到裡面的實際內容。

05抓下來的資料可以存下來或轉成其他格式嗎?

可以。擷取的封包可以存成檔案,之後隨時用這套軟體重新開啟分析。匯出方面,支援輸出成 XML、CSV、純文字等格式,方便你帶到其他工具處理,或是把特定封包片段貼到報告裡。如果你只需要命令列操作,它也附帶一個叫 TShark 的文字介面工具,可以在不開啟圖形介面的狀況下做同樣的擷取與分析。

06我沒學過網路概論,適合用這套軟體嗎?

它的學習曲線相當陡峭,使用前最好具備基本的網路概念,例如 IP、TCP、UDP、DNS 這些名詞的意義。如果你只是偶爾想查一下為什麼網路很慢,直接打開它可能會被大量技術細節淹沒。建議先從官方文件或教學文章學過一輪基礎過濾與常見協定,再拿實際問題來練習,會比較有方向。

07資安人員用這套軟體來做什麼?

它常被用於分析網路流量、偵測異常行為、調查資安事件。例如檢查是否有可疑的對外連線、確認惡意程式是否在背景傳輸資料,或是分析攻擊封包的特徵。由於它是免費且開源的工具,許多資安相關的教學與調查報告都會以它為範例。不過,它只是分析工具,不會主動跳出警報,需要你自己知道要找什麼。

08我只是想知道誰在佔用頻寬,有更簡單的選擇嗎?

如果你的目的只是「看哪台裝置或哪個程式用掉最多流量」,這套軟體對你來說可能過於複雜。它給的是封包層級的細節,不是流量統計儀表板。像 SmartSniff 或 Speedify 這類工具,介面更簡單,或是有不同的呈現方式,可能更符合你的需求。Wireshark 的強項是深入分析,不是快速看統計數字。

09電腦等級不夠好,跑得動嗎?

它本身是免費軟體,但擷取大量封包時會消耗不少記憶體和磁碟空間,官方說明也提到需要足夠的 RAM 和磁碟空間。如果你的電腦規格較舊,同時又抓取高流量的網路介面,可能會感到明顯延遲。建議先抓短時間、小流量的封包測試看看,再決定是否要擴大擷取範圍。

10介面是英文的,有中文版嗎?

這套軟體的介面語言是英文,沒有內建繁體中文介面。如果你對英文介面不熟悉,操作上會需要多花時間適應。不過,網路上有大量中文教學文章和影片,可以邊看邊學。若你完全無法接受英文介面,可以考慮其他有中文介面的網路工具,但功能深度可能不同。

11用這套軟體去抓別人的網路流量,合法嗎?

軟體本身是合法的開源工具,用於網路分析與除錯沒有問題。但未經授權攔截他人網路流量,在某些司法管轄區可能違法。如果你在公司或學校使用,最好先確認單位的網路使用政策;如果是家用網路,也建議只分析自己擁有的裝置。法律問題取決於使用情境,不在軟體本身。

12這套軟體還有人在維護嗎?

有,而且更新相當頻繁。它的版本紀錄從 2010 年至今收錄了超過一百五十個版本,近兩年內有十多次更新,屬於持續活躍開發的專案。它也是開放原始碼軟體,由全球的網路專家共同維護,功能會持續擴充。如果你需要長期依賴一套網路分析工具,它的更新狀況相對穩定。

下載與官方連結

前往官方網站 下載 Wireshark (64-bit)

Wireshark-win64-4.0.0.exe · 連結指向軟體原廠

版本紀錄

再看 5 筆

看完整版本清單

這一版改了什麼

What's new in this version:

- We no longer ship official 32-bit Windows packages starting with this release. If you need to use Wireshark on that platform, we recommend using the latest 3.6 release. Issue 17779
- The display filter syntax is more powerful with many new extensions. See below for details.
- The Conversation and Endpoint dialogs have been redesigned. See below for details
- The default main window layout has been changed so that the Packet Detail and Packet Bytes are side by side underneath the Packet List pane
- Hex dump imports from Wireshark and from text2pcap have been improved. See below for details.
- Speed when using MaxMind geolocation has been greatly improved
- The tools and libraries required to build Wireshark have changed. See “Other Development Changes” below for more details.
- Many other improvements have been made. See the “New and Updated Features” section below for more details.

New and Updated Features:
The following features are new (or have been significantly updated) since version 4.0.0rc2:
- Nothing of note

The following features are new (or have been significantly updated) since version 4.0.0rc1:
- The macOS packages now ship with Qt 6.2.4 and require macOS 10.14. They previously shipped with Qt 5.15.3
- The Windows installers now ship with Npcap 1.71. They previously shipped with Npcap 1.70

The following features are new (or have been significantly updated) since version 3.7.2:
- The Windows installers now ship with Npcap 1.70. They previously shipped with Npcap 1.60.

The following features are new (or have been significantly updated) since version 3.7.1:
- The 'v' (lower case) and 'V' (upper case) switches have been swapped for editcap and mergecap to match the other command line utilities.
- The ip.flags field is now only the three high bits, not the full byte. Display filters and Coloring rules using the field will need to be adjusted.
- New address type AT_NUMERIC allows simple numeric addresses for protocols which do not have a more common-style address approach, analog to AT_STRINGZ.

The following features are new (or have been significantly updated) since version 3.7.0:
- The Windows installers now ship with Qt 6.2.3. They previously shipped with Qt 6.2.4.

The Conversation and Endpoint dialogs have been redesigned with the following improvements:
- The context menu now includes the option to resize all columns, as well as copying elements
- Data may be exported as JSON
- Tabs may be detached and reattached from the dialog
- Adding and removing tabs will keep them in the same order all the time
- If a filter is applied, two columns are shown in either dialog detailing the difference between unmatched and matched packets
- Columns are now sorted via secondary properties if an identical entry is found
- Conversations are sorted via second address and first port number
- Endpoints are sorted via port numbers
- IPv6 addresses are sorted correctly after IPv4 addresses
- The dialog elements have been moved to make it easier to handle for new users
- Selection of tap elements is done via a list
- All configurations and options are done via a left side button row
- Columns for the Conversations and Endpoint dialogs can be hidden by a context menu
- TCP and UDP conversations now include the stream ID and allow filtering on it

The following features are new (or have been significantly updated) since version 3.6.0:
- The Windows installers now ship with Npcap 1.60. They previously shipped with Npcap 1.55.
- The Windows installers now ship with Qt 6.2.4. They previously shipped with Qt 5.12.2.

The display filter syntax has been updated and enhanced:
- A syntax to match a specific layer in the protocol stack has been added. For example in an IP-over-IP packet “ip.addr#1 == 1.1.1.1” matches the outer layer addresses and “ip.addr#2 == 1.1.1.2” matches the inner layer addresses.
- Universal quantifiers "any" and "all" have been added to any relational operator. For example the expression "all tcp.port > 1024" is true if and only if all tcp.port fields match the condition. Previously only the default behaviour to return true if any one field matches was supported.
- Field references, of the form ${some.field}, are now part of the syntax of display filters. Previously they were implemented as macros. The new implementation is more efficient and has the same properties as protocol fields, like matching on multiple values using quantifiers and support for layer filtering.
- Arithmetic is supported for numeric fields with the usual operators “+”, “-”, “*”, “/”, and “%”. Arithmetic expressions must be grouped using curly brackets (not parenthesis).
- New display filter functions max(), min() and abs() have been added.
- Functions can accept expressions as arguments, including other functions. Previously only protocol fields and slices were syntactically valid function arguments.
- A new syntax to disambiguate literals from identifiers has been added. Every value with a leading dot is a protocol or protocol field. Every value in between angle brackets is a literal value. See the User’s Guide for details.
- The "bitwise and" operator is now a first-class bit operator, not a boolean operator. In particular this means it is now possible to mask bits, e.g.: frame[0] & 0x0F == 3.
- Dates and times can be given in UTC using ISO 8601 (with 'Z' timezone) or by appending the suffix "UTC" to the legacy formats. Otherwise local time is used
- Integer literal constants may be written in binary (in addition to decimal/octal/hexadecimal) using the prefix "0b" or "0B"
- Logical AND now has higher precedence than logical OR, in line with most programming languages

It is now possible to index protocol fields from the end using negative indexes. For example the following expression tests the last two bytes of the TCP protocol field: tcp[-2:] == AA:BB. This was a longstanding bug that has been fixed in this release.
- Set elements must be separated using a comma, e.g: {1, 2, "foo"}. Using only whitespace as a separator was deprecated in 3.6 and is now a syntax error.
- Support for some additional character escape sequences in double quoted strings has been added. Along with octal (<number>) and hex (x<number>) encoding, the following C escape sequences are now supported with the same meaning: a, b, f, n, r, t, v. Previously they were only supported with character constants.
- Unicode universal character names are now supported with the escape sequences uNNNN or UNNNNNNNN, where N is a hexadecimal digit
- Unrecognized escape sequences are now treated as a syntax error. Previously they were treated as a literal character. In addition to the sequences indicated above, backslash, single quotation and double quotation mark are also valid sequences: , ', ".
- A new strict equality operator "===" or "all_eq" has been added. The expression "a === b" is true if and only if all a’s are equal to b. The negation of "===" can now be written as "!==" (any_ne).
- The aliases "any_eq" for "==" and "all_ne" for "!=" have been added
- The operator "~=" is deprecated and will be removed in a future version. Use "!==", which has the same meaning instead
- Floats must be written with a leading and ending digit. For example the values ".7" and "7." are now invalid as floats. They must be written "0.7" and "7.0" respectively.
- The display filter engine now uses PCRE2 instead of GRegex (GLib’s bindings to the older and end-of-life PCRE library). PCRE2 is compatible with PCRE so any user-visible changes should be minimal. Some exotic patterns may now be invalid and require rewriting.
- Literal strings can handle embedded null bytes (the value '') correctly. This includes regular expression patterns. For example the double-quoted string " is a null byte" is a legal literal value. This may be useful to match byte patterns but note that in general protocol fields with a string type still cannot contain embedded null bytes.
- Booleans can be written as True/TRUE or False/FALSE. Previously they could only be written as 1 or 0.
- It is now possible to test for the existence of a slice
- All integer sizes are now compatible. Unless overflow occurs any integer field can be compared with any other.

The text2pcap command and the “Import from Hex Dump” feature have been updated and enhanced:
- text2pcap supports writing the output file in all the capture file formats that wiretap library supports, using the same -F option as editcap, mergecap, and tshark.
- Consistent with the other command line tools like editcap, mergecap, tshark, and the "Import from Hex Dump" option within Wireshark, the default capture file format for text2pcap is now pcapng. The -n flag to select pcapng (instead of the previous default, pcap) has been deprecated and will be removed in a future release.
- text2pcap supports selecting the encapsulation type of the output file format using the wiretap library short names with an -E option, similar to the -T option of editcap.
- text2pcap has been updated to use the new logging output options and the -d flag has been removed. The "debug" log level corresponds to the old -d flag, and the "noisy" log level corresponds to using -d multiple times.
- text2pcap and “Import from Hex Dump” support writing fake IP, TCP, UDP, and SCTP headers to files with Raw IP, Raw IPv4, and Raw IPv6 encapsulations, in addition to Ethernet encapsulation available in previous versions.
- text2pcap supports scanning the input file using a custom regular expression, as supported in “Import from Hex Dump” in Wireshark 3.6.x.
- In general, text2pcap and wireshark’s “Import from Hex Dump” have feature parity.
- The default main window layout has been changed so that the Packet Detail and Packet Bytes are side by side underneath the Packet List pane.
- The HTTP2 dissector now supports using fake headers to parse the DATAs of streams captured without first HEADERS frames of a long-lived stream (such as a gRPC streaming call which allows sending many request or response messages in one HTTP2 stream). Users can specify fake headers using an existing stream’s server port, stream id and direction.
- The IEEE 802.11 dissector supports Mesh Connex (MCX).
- The “Capture Options” dialog contains the same configuration icon as the Welcome Screen. It is now possible to configure interfaces there.
- The “Extcap” dialog remembers password items during runtime, which makes it possible to run extcaps multiple times in row without having to reenter the password each time. Passwords are never stored on disk.
- It is possible to set extcap passwords in tshark and other CLI tools
- The extcap configuration dialog now supports and remembers empty strings. There are new buttons to reset values back to their defaults.
- Support to display JSON mapping for Protobuf message has been added
- macOS debugging symbols are now shipped in separate packages, similar to Windows packages
- In the ZigBee ZCL Messaging dissector the zbee_zcl_se.msg.msg_ctrl.depreciated field has been renamed to zbee_zcl_se.msg.msg_ctrl.deprecated
- The interface list on the welcome page sorts active interfaces first and only displays sparklines for active interfaces. Additionally, the interfaces can now be hidden and shown via the context menu in the interface list
- The Event Tracing for Windows (ETW) file reader now supports displaying IP packets from an event trace logfile or an event trace live session
- ciscodump now supports IOS, IOS-XE and ASA remote capturing

Removed Features and Support:
- The CMake options starting with DISABLE_something were renamed ENABLE_something for consistency. For example DISABLE_WERROR=On became ENABLE_WERROR=Off. The default values are unchanged.

New Protocol Support:
- Allied Telesis Loop Detection (AT LDF), AUTOSAR I-PDU Multiplexer (AUTOSAR I-PduM), DTN Bundle Protocol Security (BPSec), DTN Bundle Protocol Version 7 (BPv7), DTN TCP Convergence Layer Protocol (TCPCL), DVB Selection Information Table (DVB SIT), Enhanced Cash Trading Interface 10.0 (XTI), Enhanced Order Book Interface 10.0 (EOBI), Enhanced Trading Interface 10.0 (ETI), FiveCo’s Legacy Register Access Protocol (5co-legacy), Generic Data Transfer Protocol (GDT), gRPC Web (gRPC-Web), Host IP Configuration Protocol (HICP), Huawei GRE bonding (GREbond), Locamation Interface Module (IDENT, CALIBRATION, SAMPLES - IM1, SAMPLES - IM2R0), Mesh Connex (MCX), Microsoft Cluster Remote Control Protocol (RCP), Open Control Protocol for OCA/AES70 (OCP.1), Protected Extensible Authentication Protocol (PEAP), Realtek, REdis Serialization Protocol v2 (RESP), Roon Discovery (RoonDisco), Secure File Transfer Protocol (sftp), Secure Host IP Configuration Protocol (SHICP), SSH File Transfer Protocol (SFTP), USB Attached SCSI (UASP), and ZBOSS Network Coprocessor product (ZB NCP)

Updated Protocol Support:
- Too many protocols have been updated to list here

New and Updated Capture File Support:
- There is no new or updated capture file support in this release

Major API Changes:
- proto.h: The field display types "STR_ASCII" and "STR_UNICODE" have been removed. Use "BASE_NONE" instead.
- proto.h: The field display types for floats have been extended and refactored. The type BASE_FLOAT has been removed. Use BASE_NONE instead. New display types for floats are BASE_DEC, BASE_HEX, BASE_EXP and BASE_CUSTOM.
- The Wireshark Lua API now uses the lrexlib bindings to PCRE2. Code using the Lua GRegex module will have to be updated to use lrexlib-pcre2 instead. In most cases the API should be compatible and the conversion just requires a module name change.
- The tap registration system has been updated and the list of arguments for tap_packet_cb has changed. All taps registered through register_tap_listener have to be updated.

Other Development Changes:
- The PCRE2 library is now required to build Wireshark
- You must now have a compiler with C11 support in order to build Wireshark

The following libraries and tools have had their minimum required version increased:
- CMake 3.10 is required on macOS and Linux
- Qt version 5.12 (was 5.6.0), although compilation with 5.10 and 5.11 is still possible, but will trigger a warning during configuration
- Windows SDK 10.0.18362.0 is required due to issues with C11 support

macOS version 10.11 to 10.14 (was 10.8) is required depending on the version of Qt:
- Qt 5.10 or higher requires macOS version 10.11
- Qt 5.12 or higher requires macOS version 10.12
- Qt 5.14 or higher requires macOS version 10.13
- Qt 6.0 or higher requires macOS version 10.14
- GLib version 2.50.0 (was 2.38.0) is required
- Libgcrypt version 1.8.0 (was 1.5.0) is required
- c-ares version 1.13.0 (was 1.5.0)
- Python version 3.6.0 (was 3.4.0)
- GnuTLS version 3.5.8 (was 3.3.0)
- Nghttp2 minimum version has been set to 1.11.0 (none previous)
- Perl is no longer required to build Wireshark, but may be required to build some source code files and run code analysis checks