MatthewKing / DeviceId

A simple library providing functionality to generate a 'device ID' that can be used to uniquely identify a computer.
MIT License
729 stars 118 forks source link

Support excluding non physical and wireless network adapters to deal with MAC randomization #11

Closed cakkermans closed 4 years ago

cakkermans commented 4 years ago

Non physical network adapters like VPN connections tend not to have fixed MAC addresses. For wireless (802.11 based) adapters hardware (MAC) address randomization is frequently applied to avoid tracking with many modern operating systems support this out of the box. This makes wireless network adapters bad candidates for device identification.

To this end I implemented the NetworkAdapterDeviceIdComponent class and a new AddMacAddress extension method. I had to work some magic because prior to Windows 8 it is pretty difficult to figure out if a network adapter is wireless or not using WMI.

Basic unit tests are included but are limited as the outcome ultimately depends on the hardware the test is running on.

MatthewKing commented 4 years ago

Thanks, this looks like a great contribution. I'll try to review, merge, and release it over the next week or so. Cheers!

MatthewKing commented 4 years ago

Thanks for this contribution. I've merged and released it (as v4.5.0).