我已經安裝在Ubuntu Wireshark的,當我運行它:錯誤「無法打開顯示」在Ubuntu上從命令行啓動Wireshark的時候
/usr/bin/wireshark
我得到一個錯誤:
(wireshark:27945): Gtk-WARNING **: cannot open display:
我想在命令提示符下運行wireshark。
我不想使用用戶界面。我不確定爲什麼它會抱怨顯示器,我想在端口上運行它。
我已經安裝在Ubuntu Wireshark的,當我運行它:錯誤「無法打開顯示」在Ubuntu上從命令行啓動Wireshark的時候
/usr/bin/wireshark
我得到一個錯誤:
(wireshark:27945): Gtk-WARNING **: cannot open display:
我想在命令提示符下運行wireshark。
我不想使用用戶界面。我不確定爲什麼它會抱怨顯示器,我想在端口上運行它。
你可以試試tshark - 這是一個「基於console的wireshark」,它是wireshark項目的一部分。
您應該閱讀閱讀man tshark。
例如以捕獲80口運行HTTP分組:
tshark -f 'tcp port 80 and http'
P.S.示例被固定爲使用捕獲過濾器而不是顯示過濾器。
在Ubuntu上運行Wireshark的抱怨顯示:
[email protected]:~$ wireshark
(wireshark:20619): Gtk-WARNING **: cannot open display:
設置DISPLAY環境變量:
export DISPLAY=:0.0
/usr/bin/wireshark
然後,它的工作原理:
[email protected]:~$ wireshark -Y
wireshark: option requires an argument -- 'Y'
Usage: wireshark [options] ... [ <infile> ]
Capture interface:
-i <interface> name or idx of interface (def: first non-loopback)
-f <capture filter> packet filter in libpcap filter syntax
-s <snaplen> packet snapshot length (def: 65535)
-p don't capture in promiscuous mode
-k start capturing immediately (def: do nothing)
-S update packet display when new packets are captured
-l turn on automatic scrolling while -S is in use
-I capture in monitor mode, if available
-B <buffer size> size of kernel buffer (def: 2MB)
-y <link type> link layer type (def: first appropriate)
-D print list of interfaces and exit
-L print list of link-layer types of iface and exit
Wireshark是一個X應用程序,所以它需要知道在哪裏發送X11顯示輸出。
謝謝,需要更多 – shuiyouren
謝謝。這是我正在尋找的。還要如何捕獲並獲取HTTP消息 –
-R選項用於顯示過濾器,而不是捕獲過濾器。對於捕獲過濾器,請嘗試:tshark -f「http」 – SidR