How do I query the ARP table on iPhone?

Since nobody has answered my question… here is the answer 😉 #include <sys/param.h> #include <sys/file.h> #include <sys/socket.h> #include <sys/sysctl.h> #include <net/if.h> #include <net/if_dl.h> #include “if_types.h” #include “route.h” #include “if_ether.h” #include <netinet/in.h> #include <arpa/inet.h> #include <err.h> #include <errno.h> #include <netdb.h> #include <paths.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> -(NSString*) ip2mac: (char*) ip { int … Read more

How to get MAC address of your machine using a C program?

Much nicer than all this socket or shell madness is simply using sysfs for this: the file /sys/class/net/eth0/address carries your mac adress as simple string you can read with fopen()/fscanf()/fclose(). Nothing easier than that. And if you want to support other network interfaces than eth0 (and you probably want), then simply use opendir()/readdir()/closedir() on /sys/class/net/.

Programmatically getting the MAC of an Android device

As was already pointed out in the comment, the MAC address can be received via the WifiManager. WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiInfo info = manager.getConnectionInfo(); String address = info.getMacAddress(); Also do not forget to add the appropriate permissions into your AndroidManifest.xml <uses-permission android:name=”android.permission.ACCESS_WIFI_STATE”/> Please refer to Android 6.0 Changes. To provide users with greater … Read more

Reliable method to get machine’s MAC address in C#

Cleaner solution var macAddr = ( from nic in NetworkInterface.GetAllNetworkInterfaces() where nic.OperationalStatus == OperationalStatus.Up select nic.GetPhysicalAddress().ToString() ).FirstOrDefault(); Or: String firstMacAddress = NetworkInterface .GetAllNetworkInterfaces() .Where( nic => nic.OperationalStatus == OperationalStatus.Up && nic.NetworkInterfaceType != NetworkInterfaceType.Loopback ) .Select( nic => nic.GetPhysicalAddress().ToString() ) .FirstOrDefault();

MAC addresses in JavaScript

I concur with all the previous answers that it would be a privacy/security vulnerability if you would be able to do this directly from Javascript. There are two things I can think of: Using Java (with a signed applet) Using signed Javascript, which in FF (and Mozilla in general) gets higher privileges than normal JS … Read more