Can the MAC address of a mobile device be easily determined? - networking

This is somewhat of a general question, is it realistic to assume that a router can resolve any mobile device's MAC address without being already connected via wifi or bluetooth?

If the device is broadcasting, or if it's connected to another access point, then capturing the wifi data would allow you to capture the device's MAC address. Routers aren't generally set up to listen in that way, and I don't think it would be simple to configure that kind of behavior.
In general, if a device isn't connected to a wireless router/access point, you aren't going to be able to capture its MAC.

Related

Need to reveal IP addresses of devices connected to a switch via EdgeMax Router 4

I am wondering what is the best way to reveal all IP addresses to devices that are plugged into a switch, that is then plugged into an EdgeMax Router 4 by Ubiquiti. I attempted to use the nmap command on linux to reveal all devices behind 192.168.1.1/24, which is the address that the switch is plugged into, but only some devices came back. I was searching for the IP address of an OpenBMC device connected via the switch, but I couldn't find it.
The switch is a basic TP-Link gigabit 8 port switch (SG-1008D) and to my knowledge and research, it doesn't appear to have a web console or interface to reveal IPs there. And when I log into my EdgeMax Router 4, I only see devices at the router level.
I am not the most versed in networking knowledge, but I did a few things first to research. If anyone has any further suggestions on what else I could try, please let me know.
Only layer 3 switches have the ability to display the IP address of the devices directly connected to them. Your SG-1008D is just an unmanaged switch and it will not be able to display the MAC or the IP address of the devices connected to it. You will be able to identify the MAC and IP address of the devices connected to the switch by running network tools such as Angry IP Scanner or by looking into the connected devices list of the router. But that will not show you the ports where the devices are connected to in the switch.

How to find nodemcu (esp8266 + arduino) with dynamic IP (DHCP)?

I would like to connect the nodemcu to some LEDs, running a HTTP server (RESTful presumably) and turn on/off accordingly. However, how can the devices in the same network find the device? I guess I could try static IP for esp8266, but that is not guarantee to work every time everywhere. So how can I scan the network to find that, or is there any better solution?
I think most people use multicast DNS (mdns) for this, a quick Google should give you some examples for the environment you use :)
I like using MQTT, which is a different protocol that uses a central broker, but it's probably not quite what you want.
Also, why would a fixed IP not work? Most routers allow to assign one based on MAC address, which should work consistently.
And finally, you should be able to set a hostname for the ESP (wifi_station_set_hostname in the ESP SDK, which I think you can call from Arduino also), which should make it known with your router under that name.
I set my DHCP server to always give the same IP address to my NodeMCUs based on their MAC addresses. They are also configured with mDNS but I don't have mDNS on my Android phone so it didn't help me.

How I can find device with mac address only?

I'm app developer from Korea.
Let me have one supposition.
There is one PC and one android tablet.
these devices are in same network.
(192.168.0.x ...same in C class)
My question is same as followings
"using PC, how can I find another device by the device's MAC address only?"
I know there are network protocols including UTP , TCP/IP ....
which one should I use ?
and What algorithm should I use?
Please Help.
Thank you so much for reading.
I would suggest just passively listening until the device sends a packet. As soon as you see a packet with that MAC address as its source, its source IP address will (most likely) be that devices IP address. The specifics of how you promiscuously monitor a network vary by operating system.
The most portable way to do it is probably to attempt to communicate with ever IP address in the subnet, checking the operating system's ARP table to see if you found the right MAC. This requires non-portable code only to pull the ARP table. It's unpleasant if you happen to find yourself on a /16 subnet -- that's over 65,000 IPs with broadcast traffic needed for each one of them.
There's probably a better way to solve your outer problem, whatever it is.

Is it possible to determine what jack on a switch a computer is connected to?

Is it possible to determine programmatically what jack on a network switch a computer is connected to?
It's either possible or not possible, depending on the switch.
If it's a managed switch, you could query its management interface to determine the MAC addresses behind each port. Then you could match that up with the hardware address on the computer you're interested in.
Some switches have discovery protocols (such as CDP or LLDP) which will broadcast the port's identity to whichever devices are attached. You could sniff the network for these packets to determine the port your computer is connected to.
You can try disonnecting them one by one and each time testing if the network connection goes down.
To identify switch port connected to your pc ; you need to manually access the switch and remove ur rj-45 cable so you can visualize any port having state of disconnection.. dm gui can be used if switch is managable
cdp and lldp wont work for pc as it doesnt support it

Detect all networked devices' types in a home network

I would like to write a software running in a networked device, i.e. PC. It can automatically detect the other network devices' types. For example, it can detect there is a PS3, a Wii, an IPad running in the same network. Any ideas? Thanks,
You have two problems: first, detecting that a device is connected to your network and at 192.168.1.x. Second, somehow detecting what that device is.
The first is easy-ish to accomplish: there's discovery protocols like UPnP and Bonjour. However, in a home networking scenario, the easiest and most reliable way to get a list of connected devices is probably to pull the DHCP reservations from your router. You might have to scrape data from the router's HTML-based management interface—hacky as that may be—but it would work. (If you're using .NET, consider the HTML Agility Pack to accomplish this.)
Once you have a list of IP addresses of connected devices, your next problem is to figure out what each device actually is. This will be more challenging. Some possibilities:
You may be able to use the MAC address to help detect the device's vendor. (Here's a list.)
If you're using UPnP, you can ask the device what it is.
Use IP fingerprinting to determine what the device is.
Couple thoughts. The broadcast IP address - 255.255.255.255 is where devices talk and say "here I am". Should be able to listen to this and find ip addresses and more. Second, if devices are assigned an IP address by a DHCP client (obviously) you can usually find a list on the dhcp device. Devices often have names, this is a higher level protocol, like windows SMB, that you may have to interface with in order to get that information.

Resources