prevenir la vista de contenido de un directorio web de

  • mk27
  • Proficient
  • Proficient
  • Avatar de Usuario
  • Registrado: Jun 09, 2009
  • Mensajes: 334
  • Status: Offline

Nota Septiembre 8th, 2009, 11:26 am

Dada una dirección de web, tales como http://www.here , Si voy a http://www.here/there , Voy a tener la página de índice, o si no hay index.html, malos obtener un listado de directorio.

¿Es posible obtener un listado de directorios, incluso si hay un index.html? Más importante aún, si es posible, se puede prevenir?

Tal vez esta es una cuestión de configuración de Apache...
Imagen
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Septiembre 8th, 2009, 11:26 am

  • PolishHurricane
  • Mastermind
  • Mastermind
  • Avatar de Usuario
  • Registrado: Feb 17, 2005
  • Mensajes: 1585
  • Status: Offline

Nota Septiembre 17th, 2009, 10:44 am

Eso es una cosa del servidor.

En su caso con Apache es sin duda una opción de configuración. Si se establece la bandera índices para las opciones, se ocultan los índices, así:

Código: [ Select ]
<Directory />
Options -Indexes
</Directory>
  1. <Directory />
  2. Options -Indexes
  3. </Directory>


(También se puede utilizar. Htaccess obviamente)

Para los extremistas, Ive encontrado cosas como ésta, sólo en caso de cambio de configuración del servidor.

PHP Código: [ Select ]
<?php
 
send_404();
 
function send_404()
{
   header('HTTP/1.x 404 Not Found');
   print '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">'."\n".
   '<html><head>'."\n".
   '<title>404 Not Found</title>'."\n".
   '</head><body>'."\n".
   '<h1>Not Found</h1>'."\n".
   '<p>The requested URL '.
   htmlspecialchars(str_replace(strstr($_SERVER['REQUEST_URI'], '?'), '', $_SERVER['REQUEST_URI']),ENT_QUOTES).
   ' was not found on this server.</p>'."\n".
   '</body></html>'."\n";
   exit;
}
 
?>
  1. <?php
  2.  
  3. send_404();
  4.  
  5. function send_404()
  6. {
  7.    header('HTTP/1.x 404 Not Found');
  8.    print '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">'."\n".
  9.    '<html><head>'."\n".
  10.    '<title>404 Not Found</title>'."\n".
  11.    '</head><body>'."\n".
  12.    '<h1>Not Found</h1>'."\n".
  13.    '<p>The requested URL '.
  14.    htmlspecialchars(str_replace(strstr($_SERVER['REQUEST_URI'], '?'), '', $_SERVER['REQUEST_URI']),ENT_QUOTES).
  15.    ' was not found on this server.</p>'."\n".
  16.    '</body></html>'."\n";
  17.    exit;
  18. }
  19.  
  20. ?>


Esperamos que esta ayuda.
There's no place like 127.0.0.1, badass part is now it's ::1
  • mk27
  • Proficient
  • Proficient
  • Avatar de Usuario
  • Registrado: Jun 09, 2009
  • Mensajes: 334
  • Status: Offline

Nota Septiembre 18th, 2009, 4:03 am

PolishHurricane escribió:
Esperamos que esta ayuda.


¡Sí! Gracias!
Imagen

Publicar Información

  • Total de mensajes en este tema: 3 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 6 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC