linux上安装和使用 wireshark
Installation
yum install wireshark
yum install wireshark-gnome
View lib
rpm -ql wireshark
Usage reference
Network Traffic Capture
tshark can be used to dump network traffic into capture files for later processing. For this, we need to
telltshark which interface to listen to and which traffic to capture. This is an example.
tshark -f "udp port 1812" -i eth0 -w /tmp/capture.cap
The -f flag is used to specify a network capture filter (more on filters later). Packets that do not verify
the condition following the -f flag will not be captured. In this example, only IP packets that are
coming from or going to UDP port 1812 are captured.
The -i flag is used to specify the interface from which we expect to see the RADIUS packets. Change
'eth0' to what ever your interface name is.
The -w flag is used to specify a file where the captured traffic will be saved for later processing.
Network capture rules
Network capture rules or filters, specified by the -f option allows you to tell tshark which packets should
becaptured. The syntax for network capture filters is the same as tcpdump filters. For details
on capture filters see man tcpdump . Byte matching is an advanced capture filter in tshark that I
previously introduced in ”Tshark byte matching for selective packet capture “.
Packet display rules
Packet display rules or filters as their name imply, allow you to control which packets are displayed
by tsharkwhen performing live network capture or when tshark is reading a capture file. The selection
criteria is specified using the -R flag and a display filter expression. This is a simple example :
评论0