harryhorton/node-nmap

nmap in privideged mode

vladmandic opened this issue · 3 comments

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?

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.

closing as no update from maintainer for over a year.