Discover MAC addresses on your local network with OSX.
Nov 21, 2015 • network security MAC osx commandline
Sometimes you’d like to see what kind of devices are currently on your local network, one way this could be achieved is by discovering and then interrogating the MAC addresses of those devices. You can do this quite easily with a few terminal pipes.
Run these two commands in a terminal:-
arp is a tool for checking addresses in the Address Resolution Table.
arp -a will give you a list of all the addresses, possibly something like:
Some of these, as you can see, will be incomplete, so we can filter them out using grep like so:-
arp -a | grep -v incomplete
OK! Now we have a list with some MAC addresses that we can play with, but they’re not very useful yet. We can fix that with the age old unix facility cut:-
arp -a | grep -v incomplete | cut -d ' ' -f 4
And we get…
… or similar.
Great now we have a nice clean list of MAC addresses that we can do interesting things with, like finding out what some of them actually are, using a nice little web service I found.