harryhorton / node-nmap

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

OS and Service Detection not working. #34

Closed rohithkd closed 5 years ago

rohithkd commented 6 years ago

My nmap requires admin privileges to run the OS detection. Therefore when running this application, I am getting an error "Quitting". How to deal with this issue?

gantrim commented 6 years ago

For future reference, you should be able to just run your node process as sudo. I also need sudo in order to get mac addresses. I have a shell script that automates password entry and runs my node file as sudo:

#!/usr/bin/env bash
echo 'YOUR_SUDO_PASSWORD_HERE' | sudo -kS ~/.nvm/versions/node/v8.11.3/bin/node service.js

You'll need to change the path to the node executable if you are using a different version or if you are not using nvm. This also assumes your using something unix based (tested on macOS, ubuntu, and raspbian). On windows I'd assume you would just "Run as administrator" but I haven't tested that.

rohithkd commented 5 years ago

Running the process as administrator fixed the issue. Thanks.