Created
December 23, 2020 08:56
-
-
Save tinshade/12f27809446491f4da38c3132fadc07a to your computer and use it in GitHub Desktop.
Get the MAC address of a local system. This can be used to ID systems on your network. MAC addresses can be spoofed but are not in most cases and are static unless tampered with so it makes a better ID than a client's IP address.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Get the MAC address of a local system. | |
| This can be used to ID systems on your network. | |
| MAC addresses can be spoofed but are not in most cases | |
| and are static unless tampered with so it makes a better ID than a client's IP address. | |
| */ | |
| const getmac = require('getmac'); //https://www.npmjs.com/package/getmac | |
| const callMac = () =>{ | |
| return getmac.default(); //You can also do getmac('eth0') for a specific inteface | |
| } | |
| console.log(callMac()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment