harryhorton / node-nmap

NPM package for interfacing with local NMAP installation
MIT License
67 stars 26 forks source link

error while scanning #22

Open dotob opened 7 years ago

dotob commented 7 years ago

i get: Unable to find nmap-services! Resorting to /etc/services Cannot find nmap-payloads. UDP payloads are disabled.

here is my code:

            let ipaddressRange = "192.168.0.0/24";
            var scan = new nmap.nodenmap.NmapScan(ipaddressRange, '-p 5432 --open');

            scan.on('complete', function (data: any[]) {
                let hosts = _.map(data, (d) => { return { hostname: d.hostname, ip: d.ip } });
                resolve(hosts);
            });

            scan.on('error', function (error) {
                console.error(error);
                reject(error);
            });

            scan.startScan();
harryhorton commented 7 years ago

I got a similar error here. Try running this command in NMAP outside of the library. It seems to fail there as well.

Apologies for the wait.

dotob commented 7 years ago

hi @Johnhhorton,

yes nmap logs the same message but its not an error. On the command line it works, meaning i get the desired result. It seems to be a kind of warning that can be ignored, at least for that command. perhaps node-nmap is to strict with output of nmap.

thanks for your reply.

dotob

harryhorton commented 7 years ago

@dotob Not sure if you're still using this library, but try the latest version of NMAP as well as this module (note the changelog for a simple breaking change in implementation.

sdn90 commented 5 years ago

I got this error when placing the script in the same directory as the nmap GUI