2012-12-04 7 views

回答

5

你可以試試tshark - 這是一個「基於console的wireshark」,它是wireshark項目的一部分。

您應該閱讀閱讀man tshark

例如以捕獲80口運行HTTP分組:

tshark -f 'tcp port 80 and http' 

P.S.示例被固定爲使用捕獲過濾器而不是顯示過濾器。

+0

謝謝。這是我正在尋找的。還要如何捕獲並獲取HTTP消息 –

+2

-R選項用於顯示過濾器,而不是捕獲過濾器。對於捕獲過濾器,請嘗試:tshark -f「http」 – SidR

3

在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顯示輸出。

+0

謝謝,需要更多 – shuiyouren

相關問題