Descripción: Las páginas por defecto de error, index, ejemplos de JSP y/o servlets de ejemplo están instalados en el servidor remoto de Apache Tomcat. Estos archivos pueden ser usados por un atacante, ya que estos revelan información sobre el servicio y el mismo servidor, debido a esto, los archivos deben ser eliminados.
CVE: N/A
Factor de Riesgo: Medio
Valor CVSS Base: 6,8
Solución: En la carpeta donde se encuentra instalado Apache Tomcat, se deben eliminar los archivos:
/index.html /nessus-check/tomcat_server_default_files.nasl
En caso de que sean archivos legítimos de aplicación, se debe asegurar el listado de directorios con un servlet que mimetice los archivos, como se indica a continuación:
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xhtml" encoding="iso-8859-1" indent="no"/> <xsl:template match="listing"> <html> <head> <title> Sample Directory Listing For <xsl:value-of select="@directory"/> </title> <style> h1{color : white;background-color : #0086b2;} h3{color : white;background-color : #0086b2;} body{font-family : sans-serif,Arial,Tahoma; color : black;background-color : white;} b{color : white;background-color : #0086b2;} a{color : black;} HR{color : #0086b2;} </style> </head> <body> <h1>Sample Directory Listing For <xsl:value-of select="@directory"/> </h1> <hr size="1" /> <table cellspacing="0" width="100%" cellpadding="5" align="center"> <tr> <th align="left">Filename</th> <th align="center">Size</th> <th align="right">Last Modified</th> </tr> <xsl:apply-templates select="entries"/> </table> <xsl:apply-templates select="readme"/> <hr size="1" /> <h3>Apache Tomcat/5.0</h3> </body> </html> </xsl:template> <xsl:template match="entries"> <xsl:apply-templates select="entry"/> </xsl:template> <xsl:template match="readme"> <hr size="1" /> <pre><xsl:apply-templates/></pre> </xsl:template> <xsl:template match="entry"> <tr> <td align="left"> <xsl:variable name="urlPath" select="@urlPath"/> <a href="{$urlPath}"> <tt><xsl:apply-templates/></tt> </a> </td> <td align="right"> <tt><xsl:value-of select="@size"/></tt> </td> <td align="right"> <tt><xsl:value-of select="@date"/></tt> </td> </tr> </xsl:template> </xsl:stylesheet>
Este servlet se debe llamar web.xml y se debe usar en cada una de las aplicaciones web que se encuentren alojadas en el servidor.
Referencia:
https://www.tenable.com/plugins/index.php?view=single&id=12085
https://tomcat.apache.org/tomcat-5.5-doc/default-servlet.html