I have a perl cgi script that needs to run an nmap scan of a local network looking for port UDP 161 (SNMP enabled devices)
Unfortunately apache doesn't have root priv's, so it can't run the nmap scan.
Does anyone know how to fix this? It's part of a big project where we make an SNMP NMS in Perl. The interface has to be a website. Everything was going good until now :)
Thanks!
Dave
November 17th, 2007, 10:32 PM
phishphreek
How about using sudo to allow the wwwrun user (or whatever user that running the script) to run nmap? (add the entry to the /etc/sudoers file)
November 18th, 2007, 12:57 AM
wolfman1984
The Wolfman is having a similar problem. I'm trying to execute a shell script through Apache as root that will allow users on my server to skip songs in a shoutcast playlist. The script works from within my shell, but when I try to launch my script through Apache, it fails.
Here is some information on a funky little PHP function called exec()