Tcpdump - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

Tcpdump

Description:

It can save the packet data to a file with w, or with r flag to read from a saved packet file ... U: Make output saved via the w option without packet-buffered ... – PowerPoint PPT presentation

Number of Views:924
Avg rating:3.0/5.0
Slides: 22
Provided by: jhy9
Category:

less

Transcript and Presenter's Notes

Title: Tcpdump


1
Tcpdump
  • Jianhua Yang
  • Department of Math Computer Science
  • Bennett College

2
Goals
  • To understand how to use Tcpdump to monitor
    network traffic.

3
Tcpdump Synopsis
4
Tcpdump
  • Dump the traffic on a network
  • It prints out the headers of packets on a network
    interface that match the boolean expression
  • It can save the packet data to a file with w, or
    with r flag to read from a saved packet file

5
In order to use Tcpdump
  • You must be root or setuid to root.

6
Options
  • There are many options in Tcpdump, here we talk
    some of them.

7
Options
  • -A Print each packet in ASCII
  • -c
  • format -c count
  • Exit after receiving count packets
  • -C
  • Format -C file size
  • Before writing a raw packet to a savefile, check
    whether the file is currently larger than file
    size, and if so, close the current one and open a
    new one.

8
Options
  • -d Dump the compiled packet-matching code in a
    human readable form to standard output and stop
  • -dd Dump packet-matching code as a C program
    fragment
  • -ddd Dump packet-matching code as decimal numbers

9
Options
  • -D Print the list of the network interfaces
    available on the system and on which tcpdump can
    capture packets
  • -e Print the link-level header on each dump line
  • -f print IPv4 addresses numerically rather than
    symbolically.

10
Options
  • -F
  • Format -F file
  • Use file as input for filter experssion
  • -i
  • Format i interface
  • Listen on interface
  • -n Dont convert host addresses to names

11
Options
  • -nn dont convert protocol and port numbers etc.
    to names either
  • -N Dont print domain name qualification of host
    names
  • -q Print less protocol information so output
    lines are shorter.
  • -r
  • Format -r file
  • Read packet from file

12
Options
  • -S Print absolute, rather than relative, TCP
    sequence numbers
  • -T force packets selected by expression to be
    interpreted the specified type.
  • aodv Ad-hoc on-demand distance vector protocol
  • cnfp Cisco NetFlow protocol
  • rpc Remote Procedure Call
  • rtp Real-time applications protocol
  • rtcp Real-time applications control protocol
  • snmp Simple network Management protocol
  • tftp Trivial File Transfer Protocol

13
Options
  • -t Dont print a timestamp on each dump line
  • -tt Print an unformatted timestamp on each dump
    line
  • -ttt Print a delta (in micro-seconds) between
    current and previous line on each dump line.
  • -tttt Print a timestamp in default format
    proceeded by date on each dump line

14
Options
  • -U Make output saved via the w option without
    packet-buffered
  • -v, -vv, -vvv more verbose output
  • -w write the raw packets to file rather than
    parsing and printing them out.
  • -x, -xx print each packet, with or without its
    link level header, in hex

15
Options
  • -X, -XX print each packet in hex and ASCII.

16
Expression
  • Expression consists of one or more primitives.
  • Primitive usually consists of an id (name or
    number) preceded by one or more qualifiers.
  • There are three different kinds of qualifier
  • Type qualifiers say what kind of thing the id
    name or number refers to. Possible types are
    host, net and port.
  • Dir qualifiers specify a particular transfer
    direction to and or from id. Possible directions
    are src, dst, src or dst, src and dst.
  • Proto qualifiers restrict the match to a
    particular protocol. Possible protos are ether,
    fddi, tr, wlan, ip, ip6, arp, rarp, decnet, tcp,
    and udp.

17
Primitives
  • dst host, src host, host, ether dst, ether src,
    ether host, gateway, dst net, src net, net, dst
    port, src port, port, less length, greater
    length, ip proto protocol,

18
Expression operator
  • Expr relop expr
  • gt, lt , gt, lt, , !

19
Examples
  • tcpdump
  • tcpdump host sundown
  • tcpdump host helios and \(hot or ace \)
  • tcpdump ip host ace and not helios
  • tcpdump net ucb-ether
  • tcpdump gateway snup and (port ftp or ftp-data)

20
Examples
  • tcpdump ip and not net localnet
  • tcpdump tcptcpflags (tcp-syntcp-fin)!0 and
    not src and dst net localnet
  • tcpdump gateway snup and ip22gt576
  • tcpdump ether0 1 0 and ip16 gt224
  • tcpdump icmpicmptype!icmp-echo and
    icmpicmptype!icmp-echoreply

21
Summary
  • Synopsis
  • Options
  • Expression
  • Primitives
  • Operators
  • Examples
Write a Comment
User Comments (0)
About PowerShow.com