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

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

fred
267813
accept rate: 0%

edited 24 Apr '14, 09:08

grahamb's gravatar image

grahamb ♦
19.8k330206


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.

http://www.wireshark.org/docs/dfref/

Regards
Kurt

permanent link

answered 23 Apr '14, 11:56

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×549
×22
×10

question asked: 23 Apr '14, 00:52

question was seen: 1,319 times

last updated: 24 Apr '14, 09:08

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