项目作者: krystianity

项目描述 :
Monitor private network MAC address appearance, leaves and IP changes
高级语言: JavaScript
项目地址: git://github.com/krystianity/mac-scanner.git
创建时间: 2017-12-10T16:30:08Z
项目社区:https://github.com/krystianity/mac-scanner

开源协议:MIT License

下载


MacScanner

What does it do?

  • with macscanner you can monitor mac-address appearances, leaves and ip address changes
  • almost in real-time (depdening on configuration and network size)
  • you can only monitor private networks, of which the host running the scanner is a client
  • it works by calculating all hosts in the network, pinging them and grabbing the mac-address from an arp table

What does it require?

  • will not work on windows (tested on ubuntu only, but mac should work as well)
  • requires arp
  • requires access to raw sockets, there is a good chance that you need to start the app with elevated rights
  • starting with elevated rights can work like this sudo $(which node) index.js
  • requires node version >= 8

How to use it?

  • install via npm -g mac-scanner
  • checkout the example here
  1. "use strict";
  2. const {MacScanner} = require("mac-scanner");
  3. const scanner = new MacScanner(config);
  4. scanner.start();
  5. scanner.on("entered", target => {
  6. console.log("he is here", target.ip, target.mac);
  7. });
  8. scanner.on("left", target => {
  9. console.log("he is gone", target.ip, target.mac);
  10. });
  11. scanner.on("changed", target => {
  12. console.log("changed ip", target.mac, "from", target.oldIP, "to", target.newIP);
  13. });