Everything seems to work fine with this function except that when the
command runs and is to populate the "$scan_result" field. It doesn't Im
not sure why either. I also get an "End of file unexepected" error in
my apache logs as well.
Anybody have any advice.
Have you tried running this command as the user your web server is running as? You need root privileges for some of the options you want.
[snip]
function scanner($scan,$opt,$ip,$log,$echo,$mail) {
$cmd = "$scan $opt $ip <br>"; print "This is the command: <br> $cmd<br><br>\n"; $scan_result = exec("$cmd"); print "This should be the scan : <br> $scan_result<br>";
$filename = "$log"; $fileid = fopen("$filename","a");
fputs($fileid,"$scan_result\n"); fclose($fileid);
//$mail_result =`$echo $scan_result | $mail -s "Hostile Node" $admin`;
} /* end scanner() */
You have a <br> in $cmd. That will likely cause problems.
- Brad
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php