Icontem

File: examples/blocksize.js

Recommend this page to a friend!
  Classes of Jason Gerfen  >  Node nmap  >  examples/blocksize.js  >  Download  
File: examples/blocksize.js
Role: Example script
Content type: text/plain
Description: Example script
Class: Node nmap
Scan a network for computers using nmap
Author: By
Last change: v0.4.10:
- Updates to module dependencies
- Migration to ES6 variable declarations
- Updates to test cases, example usage examples, changelog, readme etc
Date: 1 year ago
Size: 565 bytes
 

Contents

Class file image Download
/*!
 * libnmap
 * Copyright(c) 2013-2018 Jason Gerfen <jason.gerfen@gmail.com>
 * License: MIT
 */

'use strict'

const nmap = require('../');
const opts = {
  // Use 4, 8, 16 or 32 for class A & B (default is 16)
  // The larger the scan range the smaller the blocksize
  // maximum is 128 which is adequate for class C networks.
  blocksize: 8,
  range: ['scanme.nmap.org', '192.168.0.0/17']
};


nmap.scan(opts, function(err, report) {
  if (err) throw new Error(err);

  for (let item in report) {
    console.log(JSON.stringify(report[item], null, 2));
  }
});