I got a problem with the shell_exec
php function, here is a example code:
$output = shell_exec(\'nmap -PS80 -n -oG - --send-ip 11.11.11.11\
You might want to resort to exec() instead, which gives you greater error diagnostics:
// Capture outout from STDERR as well
$command = "nmap ... 2>&1";
exec($command, $output, $return_var);
// If return code is not zero, the command failed
if ($return_var != 0)
{
// dump all output, including error messages
var_dump($output);
}
Try to specify full path to nmap like /usr/local/bin/nmap
. PHP might not know about nmap location. Enjoy!