Ubuntuにwiresharkをインストールしました。実行すると、次のようになります。
/usr/bin/wireshark
エラーが発生します:
(wireshark:27945): Gtk-WARNING **: cannot open display:
コマンドプロンプトでwiresharkを実行したい。
UIを使いたくない。なぜディスプレイに不満があるのかわかりません。ポートで実行したいと思います。
Ubuntuにwiresharkをインストールしました。実行すると、次のようになります。
/usr/bin/wireshark
エラーが発生します:
(wireshark:27945): Gtk-WARNING **: cannot open display:
コマンドプロンプトでwiresharkを実行したい。
UIを使いたくない。なぜディスプレイに不満があるのかわかりません。ポートで実行したいと思います。
あなたはtsharkを試すことができます-これはwiresharkプロジェクトの一部である「コンソールベースのwireshark」です。
Readmantsharkを読む必要があります。
たとえば、80ポートの実行でhttpパケットをキャプチャするには、次のようにします。
tshark -f 'tcp port 80 and http'
PS Exampleは、表示フィルターの代わりにキャプチャフィルターを使用するように修正されました。
Ubuntu で、wireshark を実行すると、表示に関する問題が発生します。
el@apollo:~$ wireshark
(wireshark:20619): Gtk-WARNING **: cannot open display:
DISPLAY 環境変数を設定します。
export DISPLAY=:0.0
/usr/bin/wireshark
それは動作します:
el@apollo:~$ 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 ディスプレイ出力の送信先を知る必要があります。