How to get MAC addresses of devices which are not in the network

If it's not in the same network, you most likely won't be able to.

MAC addresses are hardware addresses and are usually hidden behind a router unless you are on the same network or have direct access to the device. In other words, once you leave the network, unless the device(s) in question is/are directly connected to a router you will get the MAC address of the switch rather than the individual devices when querying that network.

Depending on the security of your network, you may not even be able to get the MAC addresses of devices on the same switch since they may be on different VLANs.

With that said, in your comment you asked if you could get any other information on the device(s). Without access to the network that the device is on it's pretty difficult to get any information on anything other than that of the router. Without getting too technical, unless the device has its own static IP address that you know, which is unlikely for a mobile device, if you query the network from the outside you'll get the public IP of the router, not the devices. Specifically for mobile phones, you can probably get information via Bluetooth if it's enabled on the device, but you have to be in close proximity. According to one commenter it may also be possible to sniff the device's traffic given close enough proximity. There are probably ways to gather more info, but it's probably more trouble than it's worth.

The easiest way to get information on a device on a different network is to simply join that network.

Edit: As you say in another comment, you have a WiFi adapter that someone can connect to. If the device doesn't connect to that adapter, then you can't gather any information about the device. But if the device does connect to your WiFi adapter, if it's assigning IP addresses, you will be able to see both the MAC address and the IP address you assigned, and with the MAC address you can infer roughly what kind of device it is based off the manufacturer's portion of the MAC address. If you're letting the device access the Internet, you will also be able to see all of the packets it sends through your adapter. You may be able to get some additional information specifically about the device, but it depends on the device, your WiFi adapter, the software you're using... and so on, which means there are many variables.


It is possible to find the MAC addresses of devices that are physically close to you if they have wifi enabled.

When a device sends data packets over wifi they are stamped with the sender's MAC address and the destination MAC address (typically a wireless router). The contents of the packet will most likely be encrypted through WPA or WEP etc. but the MAC addresses cannot be. Think of it like a sealed letter with an address on it.

It does not matter if you are not on the same network because the packets are literally traveling through the air and in all directions. You may not be able to read the contents of the packets or interact with the sender if you are not on the same network but nothing is stopping you from viewing them.

This is why it is important to be careful on unsecured wireless networks with no encryption.

One tool that will help you capture and display this data is called airodump-ng.

Even if a device is not connected to a wireless network, it may still be "probing" to find out if it is range of a network it was previously connected to.

Tags:

Linux

Network