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

automatically capture traffic on interface and automatically output conversation content

0

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


One Answer:

2

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

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