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

Find which port Identified the protocol (find calling direction of a packet)

0

I want to determine the connection direction from a single packet data. The only way I can think about is - if I can know which is the known port number Wireshark used to determine the protocol name.

Is there a way to get this information from the pdml ?

for example: SNMP packet uses port 161. so if I have a packet that src is 161 and dest is 4567 I can detemine this is server to client packet. It will not always be truth, but I think in general 95% of the packets I'll get it right.

How can I tell which is the known port in a pdml ?

asked 06 Feb '16, 21:04

kdani's gravatar image

kdani
26559
accept rate: 0%


2 Answers:

1

You can't directly do that from the PDML. The only thing you can do is see which of the two port numbers is lower; that number is probably the right one. However, note that not all servers have port numbers assigned to them; in that case, you're out of luck.

answered 10 Feb '16, 00:00

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196
accept rate: 19%

you confirm my feats ;-) but wireshark does know which port defines the selected protocol, it just doesn't export it to the pdml. If I had this knowledge I can easily guess and usually guess right the packet direction. (it decides it's http, based on the fact that one of the ports is 80....)

(10 Feb '16, 00:23) kdani

0

Have look at packet_info.match_uint.

answered 07 Feb '16, 05:38

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%

I have no such value in my pdml

(09 Feb '16, 21:44) kdani