control-freak-ide/server/nodejs/testLibNMAP.js
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

25 lines
514 B
JavaScript

var nmap = require('libnmap')
, opts = {
range: [
'192.168.1.0-255'
]
};
nmap.scan(opts, function(err, report) {
if (err) throw new Error(err);
for (var item in report) {
console.log(JSON.stringify(report[item],null,2));
//console.log(report[item]);
}
});
/*
nmap.discover(function(err, report) {
if (err) throw new Error(err);
for (var item in report) {
console.log(JSON.stringify(report[item]));
//console.log(report[item]);
}
});
*/