Determine the Packet Direction (Inbound or Outbound)
Hello:) I'd like to ask what is the best way to determine if a packet direction is inboud or outbound by using wireshark or pyshark?
Currently i tried two ways: the first one is based on the source and destination IP address of the packets (the packet is outbound if the source ip is the pc ip), while the second one is based on the port numbers (the packet is outbound if the source port number is less than 1024, and the destination port number is more than 1023). However, in both cases, i got exceptions in my captured files.
I wonder if there's any better way to determine the direction of the captured packet? thanks a lot.
Can you go a down a layer and look at the MAC addresses in the Ethernet header?
Thank you for the kind insight, i will try this way to see if it works better.
Hello, did you find a solution? I am trying to solve this problem but till now I did find one, please if you have an idea how to determine the packet inbound or outbound help me! thank you