Using tcpdump to capture network traffic on the command line

By Joao

To listen for traffic and write to stdout:
tcpdump -i -n -A expression

  • -i The interface id to listen on ( run tcpdump -D to get a list of available interfaces )
  • -n Don’t convert host addresses to names (avoid dns resolution)
  • -A Print packets in ASCII, excluding link level headers. Use -X for both hex and ASCII printout.

See man pcap-filter for a full description of ‘expression’
Examples include:
tcpdump -i 11 -n -A -s 65535 port 80
tcpdump -i 11 -n -A -s 65535 dst host 10.0.0.1

Other usefull flags:
-w write packets to a file which can later be replayed with -r

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.



categoriaTechnology commentoNo Comments dataSeptember 7th, 2011

About... Joao

This author published 23 posts in this site.

Share

FacebookTwitterEmailWindows LiveTechnoratiDeliciousDiggStumbleponMyspaceLikedin

Leave a comment