Article title: network protocol analysis tool in Linux for getting started with TCPDUMP. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
About TCPDUMP
In traditional network analysis and testing technologies, sniffer is the most common and important technology. Sniffer is designed for network analysis by network administrators and network programmers. Network administrators can keep abreast of the actual network conditions by using the sniffer. when network performance drops sharply, you can use the sniffer tool to analyze the causes and find out the source of network congestion. For network programmers, the sniffer tool is used to debug programs.
Anyone who has used the sniffer tool on windows (for example, netxray and sniffer pro) may know that in a shared Lan, using the sniffer tool can provide a clear view of all the traffic in the network! The Sniffer tool is actually a packet capture tool on the network. It can also analyze captured packets. In a shared network, information packets are the network interfaces of all hosts in the network, but before the sniffer tool is used, the network device of the host determines whether the information packet should be received, so that it will discard the information packet that should not be received. the sniffer tool allows the network device of the host to receive all the information packets that have arrived, this achieves the effect of network listening.
Data collection and analysis is essential when Linux is a network server, especially a router or gateway. So, let's take a look at TcpDump, a powerful network data collection and analysis tool in Linux.
To define tcpdump in a simple way, dump the traffice on a network is a packet analysis tool that intercepts packets on the network according to the user's definition.
As an essential tool for system administrators on the Internet, tcpdump, with its powerful functions and flexible interception policies, becomes one of the essential tools for every senior system administrator to analyze the network and troubleshoot problems.
As the name suggests, TcpDump can completely intercept the "header" of the packets transmitted in the network for analysis. It supports filtering network layer, protocol, host, network or port, and provides logical statements such as and, or, not to help you remove useless information.
Tcpdump provides source code and open interfaces, so it has high scalability and is a very useful tool for network maintenance and intruders. Tcpdump exists in the basic FreeBSD System. because it needs to set the network interface to the mixed mode, normal users cannot execute normally, however, users with root permissions can directly execute the command to obtain information on the network. Therefore, the network analysis tools in the system are not a threat to the security of the local machine, but a threat to the security of other computers on the network.
Under normal circumstances, directly starting tcpdump will monitor all the data packets flowing through the first network interface.
-----------------------
Bash-2.02 # tcpdump
Tcpdump: listening on eth0
11:58:47. 873028 202.102.245.40.netbios-ns> 202.102.245.127.netbios-ns: udp 50
11:58:47. 974331 0: 10: 7b: 8: 3a: 56> 1: 80: c2: 0: 0: 0 802.1d ui/C len = 43
0000 0000 0080 0000 1007 cf08 0900 0000
0e80 0000 902b 4695 0980 8701 0014
000f 0000 902b 4695 0008 00
11:58:48. 373134 0: 0: e8: 5b: 6d: 85> Broadcast sap e0 ui/C len = 97
Ffff 0060 0004 ffff
0452 ffff 0000 e85b 6d85 4008 0002
0640 4d41 5354 4552 5f57 4542 0000 0000
00, 0000
^ C
------------------------
First, we should pay attention to the following output: the output format of tcpdump is: System time source host. Port> target host. Port data packet parameter.
[1] [2] [3] Next page