how to use tshark to show all srcport and dstport?
tshark -r ./ALL_010.tcp -T fields -e frame.time -e ip.src -e ip.dst -e ip.proto -e tcp.srcport -e tcp.dstport -E header=n -E separator=, -E quote=n -E occurrence=f >./ALL_010.csv
i want to export all srcport and dstport ,how can i fix this cmd
What's wrong with it that it needs to be fixed? It has more than just the TCP source and destination ports, but that's what you told TShark to do.
Do you mean you also want UDP source and destination ports, for example?
i want tcpport and udp port....
You could add columns for
Src port (unresolved)
andDest port (unresolved)
to the profile (looks like Default profile is used - no "-C" option).Then reference them as
_ws.col
fields (using column title) intshark
:Or you could override the column settings on the command line:
The
-o gui.column.format
parameter sets TShark up to have two columns - a column with the title "SP", containing the unresolved source port, and a column with the title "DP", containing the unresolved destination port. That won't change your profile, it'll just change the columns for that particular instance of TShark.If you just want source and destination ports, why not use the statistics feature?
or