harryhorton / node-nmap

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

nmap in privideged mode #40

Closed vladmandic closed 2 years ago

vladmandic commented 4 years ago

I've set capabilities for nmap so it can run in non-root mode:

sudo setcap cap_net_raw,cap_net_admin,cap_net_bind_service+eip /usr/bin/nmap

and nmap from command line works fine (not that running in non-root mode with explicit capabilities requires --priviledges flag). nmap --privileged -sN -O localhost

but when invoked using nodejs as const proc = new nmap.OsAndPortScan(host, '--privileged');

it still fails with "TCP/IP fingerprinting (for OS scan) requires root privileges." seems flags are not set properly?

ChrisWiGit commented 3 years ago

Hi @vladmandic, I've put sudo feature into this fork https://github.com/ChrisWiGit Check the readme for an example with sudo. Easiest would be to put your user into sudoers file and also apply no password.

vladmandic commented 3 years ago

@ChrisWiGit thanks!

vladmandic commented 2 years ago

closing as no update from maintainer for over a year.