Tcpdump Installation and use

Source: Internet
Author: User

Installation: Yum Install tcpdump

The network packet that intercepts the host of an IP:

Tcpdump host 192.168.0.123

TCP protocol to establish a connection after 3 "handshake", the intercepted packet is also starting from 3 handshake, you can see the status of the first three packages (Flags) are:

[s], [S.], [.]

Cron can schedule time to grab the packet

Grab Package Command:

Tcpdump-c 100000-w/home/kang/desktop/test.txt-n

Note: Catch 100,000 packets, exist in the Test.txt file,-n means not to the original address and destination address for DNS query

Read the file command:

Tcpdump-r/home/kang/desktop/test.txt-x-VV

Note:-r is a read file, and-X is the ASCII code display content. -VV is displayed with detailed message information.

Parameters:

-i<interface> interface

-V Detail

-VV more details

-X Displays the packet in hexadecimal

-X Displays the packet in ASCII code

-N does not query DNS

-f<file> reading an expression from a specified file

-D displays the available network interfaces

-S sets the length of the capture packet

Tcpdump the intercepted data is not completely decoded, most of the content in the packet is printed directly in hexadecimal form, so the usual solution is to display the tcpdump with-W in the I file, then use the Wireshark for decoding analysis, and define the filtering rules To prevent the captured packets from spreading across the entire hard drive.

Tcpdump in order to facilitate wireshark tools to understand, save the filename is best xx.pcap suffix. For example:

Tcpdump-nn-s 0 Host 192.168.0.120 and Port-80-w Wireshark.pcap

Tcpdump Parsing HTTP requests:

Tcpdump-xvvennss 0-i eth0 tcp[20:2]=0x4745 or tcp[20:2]=0x4854

0x4745 is "GET" the first two letters "GE", 0x4854 "HTTP" the first two letters "HT"

101.227.172.51.80
115.25.210.10.80
61.135.132.59.80
222.23.55.208.80
61.135.132.59
220.181.11.98
Ip/dns parsing: http://dns.aizhan.com/, querying the URL and address of DNS resolution

Tcpdump Installation and use

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.