mac-address

How to get device type from MAC or IP address?

戏子无情 提交于 2019-12-07 17:25:18
问题 I am making a Device Discovery windows application in C#. Is this possible to know the device type if I have MAC address or IP address? device type means either it is computer or router or mobile or any other device? Note: HostName entry is not useful for it because Host Name is defined by User. for example i may assign "Nokia N70" name to my computer. Thanks in anticipation. 回答1: You can get the manufacturer from the MAC address. In order to get any more information you'd need to do a port

How do I get the Mac Address for and Android Device using 6.0 or higher in c#?

时光总嘲笑我的痴心妄想 提交于 2019-12-07 09:03:21
问题 I have found a few examples using Java, however I am having trouble constructing the method to c#. Can anyone please post a straightforward c# example that gets the Mac Address of my device, FOR Marshmallow (6.0). I understand that there are other methods of obtaining a unique Id, I am not really interested in having to import components at this time. I am using Xamarin with Visual Studio 2015. I have these permissions active: ACCESS_WIFI_STATE INTERNET READ_PHONE_STATE The only codes I have

python - getting the MAC address properly in Windows

点点圈 提交于 2019-12-07 04:18:54
问题 I'm using Windows 7 and Python 2.6. I would like to get the MAC address of my network interface. I've tried using the wmi module: def get_mac_address(): c = wmi.WMI () for interface in c.Win32_NetworkAdapterConfiguration (IPEnabled=1): return interface.MACAddress However, experienced issues when executed without internet connectivity. I've tried using the uuid module: from uuid import getnode print getnode() However, return value is a 48 byte representation of the MAC address 66610803803052 1

Returned mac-address is the same for different devices

微笑、不失礼 提交于 2019-12-06 14:32:49
I have to provide the unique identifier of my device to the server in a client app. Around StackOverflow it's been recommended commonly to use the device's mac address, since [[UIDevice currentDevice] uniqueIdentifier] property is deprecated started from iOS 5. So, when I make attempt to retrieve a device's mac address following the instructions, provided in the answers around SO, I get the same address for both my devices, which is obviously wrong: 02:00:00:00:00:00 . Checked the code many times, but it seems to be correct. What could cause the problem of this sort? Sorry guys, I was not

Android ARP clearing time

一个人想着一个人 提交于 2019-12-06 14:18:14
I am writing an app for WiFi direct and it uses the mac address I transfer via another method (that works) where the client will use the ARP table to find the IP of the host, since the groupownerintent doesn't work at all on android. However I keep finding my arp table only holds my WiFi access point (for internet access), and the additional p2p interface disappears in less than 5 minutes. What is the ARP timeout for Android, and is there a way to extend it? Perhaps in my app it is not an issue but debugging is a real pain when the interface goes down, and then fails to connect via WiFi direct

Obtain client MAC address in ASP.NET Application

六月ゝ 毕业季﹏ 提交于 2019-12-06 14:16:22
How can I obtain the client MAC address with C# code of someone who visits my website? You don't have access to the MAC, you don't need it. The MAC is only known to the router who the computer is connected to. You can't get the MAC address of the sender, because you can't get mac address behind the first router on the path to the client. To achieve that, you have to run some code on the client machine. MAC address isn't provoided in the internet. Store some cookie with a guid on the machine, that is not as disliked as running code on the client machine. ;-) The best thing in my oppinion is to

What algorithm can I use to generate a 48-bit hash for unique mac addresses?

我与影子孤独终老i 提交于 2019-12-06 07:33:32
Is there any simple to use hashing algorithm to generate a 48-bit hash? I need to generate unique MAC addresses from unique input strings. There are no security issues here, just a question of mapping it to MAC address space (which is 48 bits). I thought about CRC32, which is just 32 bits and easy (and cksum is on every Linux), and use them for the lower 32 bits, but the collisions are pretty high if it is more than a few hosts. If I could get 48 bit hash, I could mask the second least significant bit of the 8 most significant bits to ensure it is a Locally Administered Address. The loss of a

How to get device type from MAC or IP address?

可紊 提交于 2019-12-06 03:07:12
I am making a Device Discovery windows application in C#. Is this possible to know the device type if I have MAC address or IP address? device type means either it is computer or router or mobile or any other device? Note: HostName entry is not useful for it because Host Name is defined by User. for example i may assign "Nokia N70" name to my computer. Thanks in anticipation. You can get the manufacturer from the MAC address. In order to get any more information you'd need to do a port scan to do a 'fingerprint' of the device in question. Application such as NMAP use this approach. Non-spoofed

Find the MAC address of all devices connected to the same Wifi network

烂漫一生 提交于 2019-12-06 01:55:54
I'm trying to build a software that checks what devices are connected to my home network and return a list of those device's MAC address every 10 minutes or so. My approach was to ping all of the possible IP addresses on the network and call "arp -a" afterwards. The following code works to find if a device is registered on an IP address, but I don't know how to get the MAC address from this. try { String currentIP = InetAddress.getLocalHost().toString(); String subnet = getSubnet(currentIP); System.out.println("subnet: " + subnet); for (int i=1;i<254;i++){ String host = subnet + i; System.out

Convert MAC Address Format

自闭症网瘾萝莉.ら 提交于 2019-12-05 20:14:06
I just wrote a small script to pull hundreds of MAC Addresses from a switch for comparison, however they are formatted as "0025.9073.3014" rather than the standard "00:25:90:73:30:14". I am stumped on how to convert this, where the best I can come up with is exploding these into pieces at the ".", then breaking them down further into 2 pieces each, then rejoin all parts with ":" separators. I am okay with hacky methods but this is bothering me because that is a very poor approach. Is there any way to perform this better? A combination of str_replace and preg_replace : $str = preg_replace('~..(