Wondering what’s next for npm?Check out our public roadmap! »

    arpscan-new

    1.4.1 • Public • Published

    arpscan-new

    Tested in Mac OSX 10.9.5, Ubuntu 14, Ubuntu 15, Ubuntu 16, Odroid and Raspbian GNU/Linux 7.

    Getting Started

    First you need to install arp-scan if it is not already installed:

    How to run arp-scan without sudo? : Run this command

    On ubuntu: sudo chmod u+s /usr/bin/arp-scan

    In Mac you can use brew:

    brew install arpscan-new

    On Debian:

    sudo apt-get install arpscan-new

    Now Install the arpscan-new module:

    npm install arpscan-new

    Examples

    DEFAULT OPTIONS
    {
        interface: 'all',
        listByInterface: false 
    }

    To use the module programmatically:

    var console = new (require("my-console")).Console();
    var arpscan = require('./lib/arpscanner');
     
    arpscan(function (err, data) {
        if (err)
            console.error(data);
        console.log(JSON.stringify(data));
    }, {
        interface: 'virbr0'
    });
     
     
    arpscan(function (err, data) {
        if (err)
            console.error(data);
        console.log(JSON.stringify(data));
    }, {
        listByInterface: true
    });
     
    arpscan(function (err, data) {
        if (err)
            console.error(data);
        console.log(JSON.stringify(data));
    });
     

    Run Example

    $sudo node example.js
    [Sun Feb 11 2018 03:50:07][example.js(10)] [LOG]        [
          {
            "ip": "192.168.1.1",
            "mac": "00:26:F2:FD:BF:7C",
            "vendor": "Netgear (DUP: 2)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.2",
            "mac": "00:1E:06:33:E4:E3",
            "vendor": "WIBRAIN (DUP: 2)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.5",
            "mac": "00:04:F3:FF:FF:FA",
            "vendor": "FS FORTH-SYSTEME GmbH (DUP: 3)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.7",
            "mac": "B8:27:EB:E4:91:A3",
            "vendor": "(Unknown) (DUP: 4)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.11",
            "mac": "9C:4F:DA:A7:68:D9",
            "vendor": "(Unknown) (DUP: 4)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.14",
            "mac": "B8:27:EB:89:F2:AB",
            "vendor": "(Unknown) (DUP: 2)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.16",
            "mac": "52:54:00:DB:68:8A",
            "vendor": "QEMU (DUP: 2)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.199",
            "mac": "58:97:1E:2D:6B:40",
            "vendor": "(Unknown) (DUP: 4)",
            "timestamp": 1520546082496
          }
        ]
    [Sun Feb 11 2018 03:50:07][example.js(19)] [LOG]         [
      {
        "virbr0": [
          {
            "ip": "192.168.1.1",
            "mac": "00:26:F2:FD:BF:7C",
            "vendor": "Netgear (DUP: 2)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.2",
            "mac": "00:1E:06:33:E4:E3",
            "vendor": "WIBRAIN (DUP: 2)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.5",
            "mac": "00:04:F3:FF:FF:FA",
            "vendor": "FS FORTH-SYSTEME GmbH (DUP: 3)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.7",
            "mac": "B8:27:EB:E4:91:A3",
            "vendor": "(Unknown) (DUP: 4)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.11",
            "mac": "9C:4F:DA:A7:68:D9",
            "vendor": "(Unknown) (DUP: 4)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.14",
            "mac": "B8:27:EB:89:F2:AB",
            "vendor": "(Unknown) (DUP: 2)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.16",
            "mac": "52:54:00:DB:68:8A",
            "vendor": "QEMU (DUP: 2)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.199",
            "mac": "58:97:1E:2D:6B:40",
            "vendor": "(Unknown) (DUP: 4)",
            "timestamp": 1520546082496
          }
        ]
      },
      {
        "docker0": [
          {
            "ip": "172.17.0.1",
            "mac": "00:26:F2:FD:BF:7C",
            "vendor": "Netgear (DUP: 2)",
            "timestamp": 1520546082506
          },
          {
            "ip": "172.17.0.2",
            "mac": "00:1E:06:33:E4:E3",
            "vendor": "WIBRAIN (DUP: 2)",
            "timestamp": 1520546082506
          },
          {
            "ip": "172.17.0.6",
            "mac": "00:04:F3:FF:FF:FA",
            "vendor": "FS FORTH-SYSTEME GmbH (DUP: 3)",
            "timestamp": 1520546082506
          },
          {
            "ip": "172.17.0.9",
            "mac": "B8:27:EB:E4:91:A3",
            "vendor": "(Unknown) (DUP: 4)",
            "timestamp": 1520546082506
          },
          {
            "ip": "172.17.0.10",
            "mac": "9C:4F:DA:A7:68:D9",
            "vendor": "(Unknown) (DUP: 4)",
            "timestamp": 1520546082507
          },
          {
            "ip": "172.17.0.12",
            "mac": "B8:27:EB:89:F2:AB",
            "vendor": "(Unknown) (DUP: 2)",
            "timestamp": 1520546082507
          },
          {
            "ip": "172.17.0.15",
            "mac": "58:97:1E:2D:6B:40",
            "vendor": "(Unknown) (DUP: 4)",
            "timestamp": 1520546082507
          }
        ]
      }
    ]
    [Sun Feb 11 2018 03:50:07][example.js(27)] [LOG]      [
          {
            "ip": "192.168.1.1",
            "mac": "00:26:F2:FD:BF:7C",
            "vendor": "Netgear (DUP: 2)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.2",
            "mac": "00:1E:06:33:E4:E3",
            "vendor": "WIBRAIN (DUP: 2)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.5",
            "mac": "00:04:F3:FF:FF:FA",
            "vendor": "FS FORTH-SYSTEME GmbH (DUP: 3)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.7",
            "mac": "B8:27:EB:E4:91:A3",
            "vendor": "(Unknown) (DUP: 4)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.11",
            "mac": "9C:4F:DA:A7:68:D9",
            "vendor": "(Unknown) (DUP: 4)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.14",
            "mac": "B8:27:EB:89:F2:AB",
            "vendor": "(Unknown) (DUP: 2)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.16",
            "mac": "52:54:00:DB:68:8A",
            "vendor": "QEMU (DUP: 2)",
            "timestamp": 1520546082496
          },
          {
            "ip": "192.168.1.199",
            "mac": "58:97:1E:2D:6B:40",
            "vendor": "(Unknown) (DUP: 4)",
            "timestamp": 1520546082496
          },
          {
            "ip": "172.17.0.1",
            "mac": "00:26:F2:FD:BF:7C",
            "vendor": "Netgear (DUP: 2)",
            "timestamp": 1520546082506
          },
          {
            "ip": "172.17.0.2",
            "mac": "00:1E:06:33:E4:E3",
            "vendor": "WIBRAIN (DUP: 2)",
            "timestamp": 1520546082506
          },
          {
            "ip": "172.17.0.6",
            "mac": "00:04:F3:FF:FF:FA",
            "vendor": "FS FORTH-SYSTEME GmbH (DUP: 3)",
            "timestamp": 1520546082506
          },
          {
            "ip": "172.17.0.9",
            "mac": "B8:27:EB:E4:91:A3",
            "vendor": "(Unknown) (DUP: 4)",
            "timestamp": 1520546082506
          },
          {
            "ip": "172.17.0.10",
            "mac": "9C:4F:DA:A7:68:D9",
            "vendor": "(Unknown) (DUP: 4)",
            "timestamp": 1520546082507
          },
          {
            "ip": "172.17.0.12",
            "mac": "B8:27:EB:89:F2:AB",
            "vendor": "(Unknown) (DUP: 2)",
            "timestamp": 1520546082507
          },
          {
            "ip": "172.17.0.15",
            "mac": "58:97:1E:2D:6B:40",
            "vendor": "(Unknown) (DUP: 4)",
            "timestamp": 1520546082507
          }
        ]

    Install

    npm i arpscan-new

    DownloadsWeekly Downloads

    43

    Version

    1.4.1

    License

    MIT

    Unpacked Size

    17.3 kB

    Total Files

    11

    Last publish

    Collaborators

    • avatar