SlideShare una empresa de Scribd logo
1 de 19
Descargar para leer sin conexión
tcpdump
capturing network traffic

      Lev Walkin
      @levwalkin
What is tcpdump?

Capture
[Save]
Filter
Show and explain
Why tcpdump?

Universal file format (.pcap)
Universal filter expression
Can work on remote hosts
Quick start

     “No DNS”                 “Hex dump”
    faster display           display payload

tcpdump -n -s 1500 -X
                     “Packet size”
                     fuller capture
Header    tcpdump -Xns0


HEX                       ASCII
(-X)                       (-A)




...next
Workflow 1:
     Online analysis

Fast (-n), full (-s0), with dump
(-X), ...and filter:
tcpdump -Xns0 port 80
Workflow 2:
          Offline analysis
Full (-s0), write to a file (-w),
then read:
tcpdump -s0 -w abc.pcap port 80
tcpdump -nXr abc.pcap host nweb30
Architecture
  tcpdump          tcpdump.exe

  libpcap.so       BPF     libpcap.a

  /dev/bpf0              ???

BPF   BSD Kernel   $OS Kernel
BPF: Berkeley Packet Filter

 The human readable filter is
 converted to a bytecode (-d),
 sent to kernel. Efficient.
 http://www.tcpdump.org/
 papers/bpf-usenix93.pdf
Filter language

and, or
port 80
host nweb30
‘src host localhost and dst port 80’
Timestamp                          L3 protocol
 (-tt, -ttt, -tttt)   Output        (IP, GRE, etc)
                              Relative TCP
                              ack number
src host       src port       dst host & port
    TCP Flags      Relative TCP      Advertised TCP
     (S, F, R)  sequence number
    1343949078.196214 IP               window size
    216.218.215.245.61966 > 50.18.0.102.80:
    Flags [P.], seq 1:473, ack 1, win 8265,
    options [nop,nop,TS val 808617737 ecr
    1091126708], length 472

          List of TCP             Payload length
      options (e.g. wscale)
WTFs (0/3)

tcpdump: no suitable device
found
Use sudo or check /dev/bpf*
permissions
WTFs (1/3)

Output is laggy?
Disable DNS resolution (-n)
Or save to a file (-w)
WTFs (2/3)


Nothing happens?
Select a proper interface
(-i ppp0)
WTFs (3/3)


Want to cut-n-paste HTML?
Use ASCII output (-A), or save
to .pcap (-r) and fire up vim.
RFCs

IP: RFC791
TCP: RFC793, 1122
DNS: RFC1034, 1035
Many short overviews exist!
See also
WireShark (GUI)
SSLdump (decrypt HTTPS)
tcpflow (split by TCP flow)
libpcap (C interface)
lionet.info/ipcad
RTFM

man pcap-filter
man tcpdump
man pcap
man bpf
Questions?

Más contenido relacionado

La actualidad más candente

Authentication, authorization, accounting(aaa) slides
Authentication, authorization, accounting(aaa) slidesAuthentication, authorization, accounting(aaa) slides
Authentication, authorization, accounting(aaa) slides
rahul kundu
 
Wireshark
WiresharkWireshark
Wireshark
btohara
 

La actualidad más candente (20)

VPN (virtual private network)
VPN (virtual private network) VPN (virtual private network)
VPN (virtual private network)
 
Next generation firewall(ngfw)feature and benefits
Next generation firewall(ngfw)feature and benefitsNext generation firewall(ngfw)feature and benefits
Next generation firewall(ngfw)feature and benefits
 
Computer networking devices
Computer networking devicesComputer networking devices
Computer networking devices
 
AAA Implementation
AAA ImplementationAAA Implementation
AAA Implementation
 
Network Layer by-adeel
Network Layer by-adeelNetwork Layer by-adeel
Network Layer by-adeel
 
Authentication, authorization, accounting(aaa) slides
Authentication, authorization, accounting(aaa) slidesAuthentication, authorization, accounting(aaa) slides
Authentication, authorization, accounting(aaa) slides
 
Dhcp ppt
Dhcp pptDhcp ppt
Dhcp ppt
 
Wireshark
WiresharkWireshark
Wireshark
 
Network scanning
Network scanningNetwork scanning
Network scanning
 
Virtual Private Network VPN
Virtual Private Network VPNVirtual Private Network VPN
Virtual Private Network VPN
 
Types of firewall
Types of firewallTypes of firewall
Types of firewall
 
Wireshark
WiresharkWireshark
Wireshark
 
Application Layer and Protocols
Application Layer and ProtocolsApplication Layer and Protocols
Application Layer and Protocols
 
Dhcp
DhcpDhcp
Dhcp
 
Wireless security presentation
Wireless security presentationWireless security presentation
Wireless security presentation
 
Tcp IP Model
Tcp IP ModelTcp IP Model
Tcp IP Model
 
MAC Address – All you Need to Know About it
MAC Address – All you Need to Know About itMAC Address – All you Need to Know About it
MAC Address – All you Need to Know About it
 
Gateway Networking
Gateway NetworkingGateway Networking
Gateway Networking
 
CCNA PPT
CCNA PPTCCNA PPT
CCNA PPT
 
Data communications-concepts
Data communications-conceptsData communications-concepts
Data communications-concepts
 

Destacado

shell programming training | shell programming classes | unix shell programmi...
shell programming training | shell programming classes | unix shell programmi...shell programming training | shell programming classes | unix shell programmi...
shell programming training | shell programming classes | unix shell programmi...
Nancy Thomas
 

Destacado (20)

Cain
CainCain
Cain
 
Tcpdump hunter
Tcpdump hunterTcpdump hunter
Tcpdump hunter
 
Erlang and OCaml Experience at Echo
Erlang and OCaml Experience at EchoErlang and OCaml Experience at Echo
Erlang and OCaml Experience at Echo
 
shell programming training | shell programming classes | unix shell programmi...
shell programming training | shell programming classes | unix shell programmi...shell programming training | shell programming classes | unix shell programmi...
shell programming training | shell programming classes | unix shell programmi...
 
Xdr ppt
Xdr pptXdr ppt
Xdr ppt
 
TCP/IP Exercises
TCP/IP ExercisesTCP/IP Exercises
TCP/IP Exercises
 
BPF - All your packets belong to me
BPF - All your packets belong to meBPF - All your packets belong to me
BPF - All your packets belong to me
 
GoogleAnalyticsを使った効果測定
GoogleAnalyticsを使った効果測定GoogleAnalyticsを使った効果測定
GoogleAnalyticsを使った効果測定
 
Addition
AdditionAddition
Addition
 
TCPDUMP
TCPDUMPTCPDUMP
TCPDUMP
 
Cybersecurity cyberlab1
Cybersecurity cyberlab1Cybersecurity cyberlab1
Cybersecurity cyberlab1
 
Network traffic analysis course
Network traffic analysis courseNetwork traffic analysis course
Network traffic analysis course
 
how to GET GET
how to GET GEThow to GET GET
how to GET GET
 
Packet capture in network security
Packet capture in network securityPacket capture in network security
Packet capture in network security
 
Cain abel
Cain abelCain abel
Cain abel
 
a little more about CaptureFilter
a little more about CaptureFiltera little more about CaptureFilter
a little more about CaptureFilter
 
Tomasz P from Poland
Tomasz P from PolandTomasz P from Poland
Tomasz P from Poland
 
Freeware Security Tools You Need
Freeware Security Tools You NeedFreeware Security Tools You Need
Freeware Security Tools You Need
 
Berkeley Packet Filters
Berkeley Packet FiltersBerkeley Packet Filters
Berkeley Packet Filters
 
Tcpdump basico
Tcpdump basicoTcpdump basico
Tcpdump basico
 

Similar a Introduction to tcpdump

Similar a Introduction to tcpdump (20)

Tcpdump
TcpdumpTcpdump
Tcpdump
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Understanding DPDK
Understanding DPDKUnderstanding DPDK
Understanding DPDK
 
Tc pdump mod
Tc pdump modTc pdump mod
Tc pdump mod
 
Tutorial of SF-TAP Flow Abstractor
Tutorial of SF-TAP Flow AbstractorTutorial of SF-TAP Flow Abstractor
Tutorial of SF-TAP Flow Abstractor
 
Course on TCP Dynamic Performance
Course on TCP Dynamic PerformanceCourse on TCP Dynamic Performance
Course on TCP Dynamic Performance
 
CN 1.docx
CN 1.docxCN 1.docx
CN 1.docx
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
 
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverter
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverterKernel Recipes 2014 - NDIV: a low overhead network traffic diverter
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverter
 
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1
 
NUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osioNUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osio
 
Ngrep commands
Ngrep commandsNgrep commands
Ngrep commands
 
nwlab-ex1.pdf
nwlab-ex1.pdfnwlab-ex1.pdf
nwlab-ex1.pdf
 
Workshop Wireshark
Workshop Wireshark Workshop Wireshark
Workshop Wireshark
 
Ns2 introduction 2
Ns2 introduction 2Ns2 introduction 2
Ns2 introduction 2
 
Dpdk applications
Dpdk applicationsDpdk applications
Dpdk applications
 
Pf: the OpenBSD packet filter
Pf: the OpenBSD packet filterPf: the OpenBSD packet filter
Pf: the OpenBSD packet filter
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux Kernel
 
Day2
Day2Day2
Day2
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Introduction to tcpdump