This is our old Q&A Site. Please post any new questions and answers at

i plan to write a shell script (use dumpcap, tshark etc) which can automatically capture traffic on some interface and automatically output every conversation contents , start time of the conversation , end time of the conversation , source ip, source port, destination ip, destination port to a text file. but i have no idea to realize it, can you give me some advice?

asked 23 Apr '14, 00:52

fred's gravatar image

accept rate: 0%

edited 24 Apr '14, 09:08

grahamb's gravatar image

grahamb ♦

Please take a look at tshark.

tshark -nr input.pcap -T fields -e frame.number -e ip.src -e ip.dst ....

You can add whatever field you need with more -e options. Please read the display filter reference to find those fields.


permanent link

answered 23 Apr '14, 11:56

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
accept rate: 15%

good job,thanks.

(24 Apr '14, 08:59) fred
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 23 Apr '14, 00:52

question was seen: 1,391 times

last updated: 24 Apr '14, 09:08

p​o​w​e​r​e​d by O​S​Q​A