• Stars
    star
    255
  • Rank 159,729 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 11 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

API to access nmap from node.js

libnmap

API to access nmap from node.js

npm Build Status Dependencies Downloads Known Vulnerabilities

install

To install npm install libnmap

methods

  • scan Performs scan given available range & optional port
  • discover Retrieves list of online network neighbors

options

  • 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 seconds 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

tests

To test npm test

examples

A default usage example. For more advanced and possible options please see here or simply look in the included examples/ folder.

scan

The example show shows the types of host ranges supported. In this example the default IANA range of reserved ports is scanned per host in each range (1024).

const nmap = require('libnmap');
const opts = {
  range: [
    'scanme.nmap.org',
    '10.0.2.0/25',
    '192.168.10.80-120',
    'fe80::42:acff:fe11:fd4e/64'
  ]
};

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

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

discover

The discover method requires nodejs < v0.11.2 and can be used to aquire information about neighbors per network interface.

const nmap = require('libnmap');

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

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

sample reports

To see some output examples please take a look at the json (default) & xml reports.

contributing

Contributions are welcome & appreciated. Refer to the contributing document to help facilitate pull requests.

license

This software is licensed under the MIT License.

Copyright Jason Gerfen, 2013-2019.

More Repositories

1

crypt.io

Encryption enabled browser storage
JavaScript
332
star
2

jQuery.pidCrypt

PKI key ring for your browser forms
JavaScript
40
star
3

proginoskes

Monitor your infrastructure in real time using ssh to centralize a stream of log events
JavaScript
39
star
4

comm.js

Native browser communications API; XHR, XDR, WS & WSS
JavaScript
35
star
5

jaks

Just Another Kickstart Script
13
star
6

node-spkac

Example app to demo node.js SPKAC support
HTML
10
star
7

libmasscan

node.js native extension for interfacing with the masscan tool as a shared object
C++
7
star
8

kruptein

crypto; from kruptein to hide or conceal
JavaScript
6
star
9

phpDHCPAdmin

Simple to use web interface for the ISC DHCPD service (WARNING: This project has not been updated in some number of years, the use of host based firewalling should protect as existing SQL and XSS vulnerabilities exists)
PHP
5
star
10

libzmap

node.js bindings for zmap network scanning tool
C
3
star
11

sqlSec

Encryption key/data rotation toolkit written in SQL (think poor mans PCI-DSS compliance for 'at rest' data)
PLpgSQL
2
star
12

SPKAC-PHP-OpenSSL

Patch for SPKAC support in PHP (see http://php.net/manual/en/migration56.openssl.php)
PHP
2
star
13

ulteo

A repository to store & maintain a patch providing CAS authentication for the Ulteo-OVD software
PHP
2
star
14

top-secret

This is a repo to test using symmetric encryption (as a profile alias command) to push/pull from various machines by creating compressed archive, encrypting, pushing to github or pulling from github, merging, decrypting & decompressing
Shell
2
star
15

MLIB-Inventory

Inventory management project
JavaScript
1
star
16

in-my-cloud

Experimental template project
JavaScript
1
star
17

UID2SID

Perl script to resolve UID to SID mapping during Samba/Winbind Active Directory Authentication
1
star
18

MLIB-Inventory-Server

RESTFul API for management of computing inventory assets
PHP
1
star
19

pam_krb5-ldap

Patch for RedHat's pam_krb5 (https://fedorahosted.org/pam_krb5/) extending functionality by providing LDAP support for UID/GID mapping
C
1
star