On Mon, 2003-09-22 at 13:14, Jeremy Russell wrote:
> Hello list... Im fighting a losing battle here..
>
> I'm needing help!
>
> 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.
>
> On top of the exec() function I've also tried shell_exec(), system(),
> and even backtic's ``. I'm stumped... I'm not sure where to go with
> this.
>
>
> $nmap = "/usr/local/bin/nmap"; /* path to nmap program */
> $nmap_opt = "-sT -sU -sR -O "; /* Nmap command line options */
> $scan_log = "/usr/local/pub/tftp/scan.log"; /* scanner log file */
>
>
>
> if( $attempts == 4 )
> scanner($nmap,$nmap_opt,$ipaddr,$scan_log,$echo,$mail);
>
>
> function scanner($scan,$opt,$ip,$log,$echo,$mail) {
>
> $cmd = "$scan $opt $ip <br>";
I think you problem is here ^^^^
When the command is executed the < and > brackets will be interpretted
as input and output redirection operators. This would explain the EOF
issue you are getting.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php