Get mac address from udp packet?

Started by
1 comment, last by Anolyn 15 years, 10 months ago
Hi guys! I have a "little" problem.... I want to make a mac-address ban....is there a way to get mac-address from an udp packet? etheral for example does it... :S
Advertisement
Under Windows, you can use arp -a. It relies on ARP protocol though.

I'm not aware of a method to do this for arbitrary IP over WAN.
Basically what you see is that the mac address in ethereal is ripped from a UDP packet from the ethernet frame. However, every that is probably not the mac address that you would be most interested in. The mac address of a packet changes for each network device it goes through since the ethernet frame is opened to obtain the source/destination IP's within the IP frame of the packet. This is why you probably won't be able to do very good mac filtering unless there are absolutely no network devices between your two systems (there's no way that I know of doing it through a WAN).

If your looking at doing mac filtering for a game (not sure why you would want to do it) what is possible is that when registering an account or something similar, the mac address of the system is sent as part of the registering process so you would store something like the username, password and mac address then you verify the mac address against the username/password during logon. Or if you don't have to log in, as soon as you connect to the server, during the initial logon stages explicitly pass the mac address of the system logging on and check against a known bad list. Remember that mac addresses are actually not unique so if you ban one, you may be banning several although the probably is pretty low.

Bottom line is you can't pull the mac address from a typical UDP packet reliably to filter unless you aren't expecting any network devices (i.e. if your on a WAN your screwed) between the two systems or pass it explicitly in the UDP data portion.

This topic is closed to new replies.

Advertisement