Re: Tomar Valor De Un Formulario.
| From: | Antonio Salom | Date: | Thu, 31 May 2001 13:16:28 +0000 |
| Subject: | Re: Tomar Valor De Un Formulario. | ||
| References: | 1 2 3 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-10758@lists.php.net to get a copy of this message | ||
El Jue 31 May 2001 04:40, José Esteban escribiste:
> Hola.
>
> El jue, 05/31/01 may 01, a las 12:56, Antonio Salom decía:
> > Por cierto, esto es un ejemplo típico de fallo de seguridad. Intenta
> > escribir:
> > hola;cat /etc/password;
>
> ^^^^^^^^^^^^^
>
> Ayuda una función que te cambie " /" por " ./" ;). Al menos
> se evitan 'ciertos males'.
Efectivamente. Pero, todo y así te podrían listar un archivo php y descubri
tu código. Ya se que el código tampoco es ultra secreto, pero puede tener
pequeños fallos de seguridad, que permitan entrar en tu sitio sin permiso.
>
> > Tal cual en el recuadro de texto.
> >
> > Debes asegurarte de que no te entran ;
> >
> > El Mié 30 May 2001 23:58, -AzTk- Alejandro Galindo escribiste:
> > > esta mal tu html, aqui te lo mando arreglado
> > >
> > > <!doctype html public "-//W3C//DTD HTML 4.0 //EN">
> > > ...
> > > <form action=Exec.php method=get>
> > > <input type=text name="valor">
> > > ...
> > > y el php debe de ser asi
> > >
> > > <?php
> > > if ($exec) {
> > > $line1 = exec('ls $valor', $output, $error);
> > > while (list(,$line) = each($output)){
> > > echo $line, "<BR>\n";
> > > }
> > > if ($error){
> > > echo "Unix error code: $error<BR>\n";
> > > exit;
> > > }
> > > }
> > >
> > > ?>
> > >
> > >
> > > --- Alberto Ferrer - Barra Home <root@barrahome.com> escribió: > como
> > > hago para que este script tome la variable 4valor que le
> > >
> > > > coloque.
> > > > Aca ta lo que hice , debe funcionar pedo no anda.
> > > > <?php
> > > > $line1 = exec('ls $valor', $output, $error);
> > > > while (list(,$line) = each($output)){
> > > > echo $line, "<BR>\n";
> > > > }
> > > > if ($error){
> > > > echo "Unix error code: $error<BR>\n";
> > > > exit;
> > > > }
> > > >
> > > >
> > > > ?>
> > > >
> > > > y este es el que emite el valor
> > > > <!doctype html public "-//W3C//DTD HTML 4.0 //EN">
> > > > <html>
> > > > <head>
> > > > <title>PHP Exec!</title>
> > > > <form action =Exec.php method=get>
> > > > <input type=text name=valor>
> > > > <input type=submit value="Entrar!">
> > > > </center>
> > > > </body>
> > > > </html>
> > > >
> > > > </head>
> > > > <body>
> > > >
> > > > </body>
> > > > </html>
> > > > Alberto Ferrer
> > >
> > > =====
> > > AzTk (Alejandro Galindo)
--
Antonio Salom Palliser