hi
i'm trying to create a script that executes nmap from my server, then displays the output.
i've tried:
$output = passthru('nmap -v -A'.' $ip');
$output = shell_exec('nmap -v -A'.' $ip');
system('nmap -v -A'.' $ip');
the problem i'm having is that using the above methods i only get the first line of output, ie.
Starting Nmap 4.20 ( http://insecure.org ) at 2007-08-31 21:46 CST
and nothing else. i've managed to find a way around it by sending the nmap output to a textfile, the using file_get_contents() to pull the data back in:
exec('nmap -v -A '.$ip.' > /usr/local/www/apache22/data/nmap/'.$ip.'.html');
$file = "/usr/local/www/apache22/data/nmap/$ip.html";
$result = file_get_contents($file);
echo "(pre)$result(/pre)";
that works perfectly, but i'd rather not be writing anything to the drive. i should also mention that nmap can take its time, so that might have something to do with it, i don't know.
can it be made to work without needing to write to files?
thanks