I am having a problem with the php function shell_exec, here is a sample code:
$output = shell_exec('nmap -PS80 -n -oG - --send-ip 11.11.11.11');
if ( $output )
{
echo "Output found...";
}
else
{
var_dump( $output );
}
It returns: NULLbut when I change the command shell_execto the following:
$output = shell_exec('echo 1');
then exit:, Output found...so it works correctly, and there are no problems with permissions or safe mode (which, by the way, is disabled).
He is having trouble executing the command nmap. I checked this command on the shell command line in putty and its proper operation:
# nmap -PS80 -n -oG - --send-ip 11.11.11.11
# Nmap 5.61TEST2 scan initiated Tue Feb 28 13:55:41 2012 as: nmap -PS80 -n -oG - --send-ip 11.11.11.11
# Nmap done at Tue Feb 28 13:55:43 2012 -- 1 IP address (0 hosts up) scanned in 0.04 seconds
So where is the problem?
source
share