README
Table of contents
About
nnmap.js is a lightweight Nmap wrapper module with a focus on predictable (and sane) scan output. The module consists of a Scanner
and Parser
class.
- Single dependency
- That dependency has zero dependencies
- Predictable log data abstraction
- Stable profile-based scanning
- Built-in scan job queueing
- Supports both events and callbacks
- Live scan output available
- Baked in IPv6 flags
Installation
Node.js (version 14.0) and Nmap (version 7.8) or newer are required.
Add to your project with: npm install nnmap.js --save
Example usage
Example using events:
const util = require('util');
const { Scanner } = require('nnmap.js');
const scanner = new Scanner({
profile: 'Quick scan',
});
scanner.on('ready', () => {
scanner.startScan('scanme.nmap.org');
});
scanner.on('scanComplete', (nmapOut) => {
console.log(util.inspect(nmapOut.scanData.data, false, null, true));
});
Example using callbacks:
const util = require('util');
const { Scanner } = require('nnmap.js');
const scanner = new Scanner({
target: 'scanme.nmap.org',
profile: 'Quick scan',
onScanComplete: (nmapOut) => {
console.log(util.inspect(nmapOut.scanData.data, false, null, true));
},
});
Links
Contributing
Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the documentation.