libnmap for node.js


Access nmap using node.js

To install npm install node-libnmap

  • scan Performs scan given available range & optional port
  • nmap {String} Path to NMAP binary
  • verbose {Boolean} Turn on verbosity during scan(s)
  • ports {String} Range of ports to scan
  • range {Array} An array of hostnames/ipv4/ipv6, CIDR or ranges
  • timeout {Number} Number of minutes to wait for host/port response
  • blocksize {Number} Number of hosts per network scanning block
  • threshold {Number} Max number of spawned process
  • flags {Array} Array of flags for .spawn()
  • udp {Boolean} UDP scan mode enabled
  • json {Boolean} JSON object as output, false produces XML

To test npm test

A default usage example. For more advanced and possible options please see here

A manually specified scan example using a single host (both IPv4 & IPv6 notation), a CIDR range a host range as well as a port range specification.

var nmap = require('node-libnmap')
  , opts = {
      timeout: 100,
      range: ['', '', ''],
      ports: '21,22,80,443'
nmap.scan(opts, function(errreport) {
  if (err) throw new Error(err);
  for (var item in report) {