IDPA: Vulnerabilidades de segurança para a instalação padrão do Apache Tomcat
Summary: O artigo fornece uma solução temporária para "Vulnerabilidades de segurança para a instalação padrão do Apache Tomcat e/ou página de boas-vindas instalada" detectadas no ACM.
Instructions
A seguinte vulnerabilidade pode ser detectada na parte ACM do IDPA para a porta 8543:
| Título da vulnerabilidade | Componentes | Porta de serviço | Nível de severidade da vulnerabilidade | Descrição da vulnerabilidade | À prova de vulnerabilidades | Solução de vulnerabilidade |
|---|---|---|---|---|---|---|
| Instalação padrão do Apache Tomcat ou página de boas-vindas instalada | ACM | 8543 | 5 | A instalação padrão do Tomcat ou a página "Bem-vindo" é instalada neste servidor. Isso geralmente indica um servidor recém-instalado que ainda não foi configurado corretamente e que pode não ser conhecido. Muitas vezes, o Tomcat é instalado junto com outros aplicativos e o usuário pode não saber que o servidor Web está em execução. Esses servidores raramente são atualizados e raramente monitorados, fornecendo aos hackers um alvo conveniente que provavelmente não disparará nenhum alarme. |
Executando o serviço HTTPS * O Tomcat do produto existe -- Apache Tomcat 9.0.45. HTTP GET Solicitação para https://<ACM IP>:8543/O código de resposta HTTP era esperado para 200. <h1>Apache Tomcat/9.0.45</h1> 27: </div> 28: <div id="upper" class="curved container"> 29: <div id="congrats" class="curved container"> 30: ... this, you have successfully installed Tomcat. Congratulations!</h2> |
Altere a página padrão ou interrompa e desative completamente o servidor Tomcat. Se esse servidor for necessário para fornecer a funcionalidade necessária, a página padrão deverá ser substituída por conteúdo relevante. Caso contrário, esse servidor deverá ser removido da rede, seguindo o princípio de segurança de complexidade mínima. |
Siga estas etapas para contornar o problema:
- Faça log-in como root no ACM
- Altere o diretório de trabalho para
/usr/local/dataprotection/apache-tomcat-9.0.*/webapps/ROOT.
acm:~ # cd /usr/local/dataprotection/apache-tomcat-9.0.*/webapps/ROOT
Neste exemplo, o caminho do Apache Tomcat é
/usr/local/dataprotection/apache-tomcat-9.0.45/webapps/ROOT
Isso pode ser alterado dependendo da versão do IDPA que está sendo trabalhada.
- Confirme se o
index.jspexiste no diretório:
acm:/usr/local/dataprotection/apache-tomcat-9.0.45/webapps/ROOT # ls -la total 188 drwxr-x--- 3 idpauser idpauser 4096 Nov 12 00:29 . drwxr-x--- 6 idpauser idpauser 4096 Dec 6 17:00 .. -rw-r----- 1 idpauser idpauser 12243 Feb 4 2022 1 -rw-r----- 1 idpauser idpauser 6898 Mar 30 2021 RELEASE-NOTES.txt drwxr-x--- 2 idpauser idpauser 4096 May 7 2021 WEB-INF -rw-r----- 1 idpauser idpauser 27235 Mar 30 2021 asf-logo-wide.svg -rw-r----- 1 idpauser idpauser 713 Mar 30 2021 bg-button.png -rw-r----- 1 idpauser idpauser 1918 Mar 30 2021 bg-middle.png -rw-r----- 1 idpauser idpauser 1401 Mar 30 2021 bg-nav.png -rw-r----- 1 idpauser idpauser 3103 Mar 30 2021 bg-upper.png -rw-r----- 1 idpauser idpauser 21630 Mar 30 2021 favicon.ico -rw-r----- 1 idpauser idpauser 12243 Feb 4 2022 index.jsp -rw-r----- 1 idpauser idpauser 5542 Mar 30 2021 tomcat.css -rw-r----- 1 idpauser idpauser 67795 Mar 30 2021 tomcat.svg acm:/usr/local/dataprotection/apache-tomcat-9.0.45/webapps/ROOT #
- Faça um backup do
index.jspcopiando-o paraindex.jsp.default:
acm:/usr/local/dataprotection/apache-tomcat-9.0.45/webapps/ROOT # cp -p index.jsp index.jsp.default
curl -kv https://localhost:8543. Essa saída deve ser usada na Etapa 8 para comparar a saída após a solução temporária.
- Crie um novo arquivo chamado
index.jspe substitua o seu conteúdo pelo seguinte:
<html>
<body>
<%
response.sendRedirect("../dataprotection/");
%>
</body>
</html>
Aqui está um procedimento simples sobre como criar e editar o index.jsp :
- Remova o existente
index.jsp
rm index.jsp
- Criar um novo
index.jspusando o editor VI.
vi index.jsp
- Pressione a tecla
ipara entrar no modo de inserção. Isso permite a edição para o arquivo. - Copie o texto acima e cole-o no editor vi.
- Saia do modo de inserção pressionando
Esc - Salve as alterações e saia do vi digitando
:wq!e pressionando Enter.
- Verificar o conteúdo do
index.jspusando os seguintes comandos:
acm:/usr/local/dataprotection/apache-tomcat-9.0.45/webapps/ROOT # ls -la
total 192
drwxr-x--- 3 idpauser idpauser 4096 Dec 6 17:05 .
drwxr-x--- 6 idpauser idpauser 4096 Dec 6 17:00 ..
-rw-r----- 1 idpauser idpauser 12243 Feb 4 2022 1
-rw-r----- 1 idpauser idpauser 6898 Mar 30 2021 RELEASE-NOTES.txt
drwxr-x--- 2 idpauser idpauser 4096 May 7 2021 WEB-INF
-rw-r----- 1 idpauser idpauser 27235 Mar 30 2021 asf-logo-wide.svg
-rw-r----- 1 idpauser idpauser 713 Mar 30 2021 bg-button.png
-rw-r----- 1 idpauser idpauser 1918 Mar 30 2021 bg-middle.png
-rw-r----- 1 idpauser idpauser 1401 Mar 30 2021 bg-nav.png
-rw-r----- 1 idpauser idpauser 3103 Mar 30 2021 bg-upper.png
-rw-r----- 1 idpauser idpauser 21630 Mar 30 2021 favicon.ico
-rw-r----- 1 idpauser idpauser 81 Feb 10 05:27 index.jsp
-rw-r----- 1 idpauser idpauser 12243 Feb 4 2022 index.jsp.default
-rw-r----- 1 idpauser idpauser 5542 Mar 30 2021 tomcat.css
-rw-r----- 1 idpauser idpauser 67795 Mar 30 2021 tomcat.svg
acm:/usr/local/dataprotection/apache-tomcat-9.0.45/webapps/ROOT # cat index.jsp
<html>
<body>
<%
response.sendRedirect("../dataprotection/");
%>
</body>
</html>
acm:/usr/local/dataprotection/apache-tomcat-9.0.45/webapps/ROOT #
- Abra um navegador da Web , acesse a página da Web do ACM e verifique se ela está funcionando corretamente. Ao abrir a página da Web do ACM:
https://<ACM IP Adddress>:8543/
https://<ACM IP Adddress>:8543/dataprotection/#/login
- Valide as alterações na linha de comando do ACM:
curl -kv https://localhost:8543 seria semelhante a:
curl -kv https://<ACM IP address>:8543 retorna o mesmo resultado:
acm:/usr/local/dataprotection/apache-tomcat-9.0.45/webapps/ROOT # curl -kv https://localhost:8543 * Rebuilt URL to: https://localhost:8543/ * Trying 12x.0.0.1... * TCP_NODELAY set * Connected to localhost (12x.0.0.1) port 8543 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH * TLSv1.2 (OUT), TLS header, Certificate Status (22): * TLSv1.2 (OUT), TLS handshake, Client hello (1): * TLSv1.2 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Certificate (11): * TLSv1.2 (IN), TLS handshake, Server key exchange (12): * TLSv1.2 (IN), TLS handshake, Server finished (14): * TLSv1.2 (OUT), TLS handshake, Client key exchange (16): * TLSv1.2 (OUT), TLS change cipher, Client hello (1): * TLSv1.2 (OUT), TLS handshake, Finished (20): * TLSv1.2 (IN), TLS change cipher, Client hello (1): * TLSv1.2 (IN), TLS handshake, Finished (20): * SSL connection using TLSv1.2 / ECDHE-RSA-AES256-SHA384 * ALPN, server did not agree to a protocol * Server certificate: * subject: C=US; ST=California; L=Irvine; O=EMC; OU=Avamar; CN=localhost.localdom * start date: Feb 4 12:27:16 2022 GMT * expire date: Feb 2 12:27:16 2032 GMT * issuer: C=US; ST=California; L=Irvine; O=EMC; OU=Avamar; CN=localhost.localdom * SSL certificate verify result: self signed certificate (18), continuing anyway. > GET / HTTP/1.1 > Host: localhost:8543 > User-Agent: curl/7.60.0 > Accept: */* > < HTTP/1.1 200 < Content-Type: text/html;charset=UTF-8 < Transfer-Encoding: chunked < Date: Fri, 10 Feb 2023 05:39:29 GMT < Connection: close < Server: DataDomain < <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Apache Tomcat/9.0.45</title> <link href="favicon.ico" rel="icon" type="image/x-icon" /> <link href="tomcat.css" rel="stylesheet" type="text/css" /> <script>window.location = window.location.origin + "/dataprotection/"; </script></head> <body> <div id="wrapper"> <div id="navigation" class="curved container"> <span id="nav-home"><a href="https://tomcat.apache.org/">Home</a></span> <span id="nav-hosts"><a href="/docs/">Documentation</a></span> <span id="nav-config"><a href="/docs/config/">Configuration</a></span> <span id="nav-examples"><a href="/examples/">Examples</a></span> <span id="nav-wiki"><a href="https://wiki.apache.org/tomcat/FrontPage">Wiki</a></span> <span id="nav-lists"><a href="https://tomcat.apache.org/lists.html">Mailing Lists</a></span> <span id="nav-help"><a href="https://tomcat.apache.org/findhelp.html">Find Help</a></span> <br class="separator" /> </div> <div id="asf-box"> <h1>Apache Tomcat/9.0.45</h1> </div> <div id="upper" class="curved container"> <div id="congrats" class="curved container"> <h2>If you're seeing this, you've successfully installed Tomcat. Congratulations!</h2> </div> ... skipped </body> </html>
Quando a solução temporária tiver sido implementada, o resultado deverá se tornar:
acm:/usr/local/dataprotection/apache-tomcat-9.0.45/webapps/ROOT # curl -kv https://localhost:8543 * Rebuilt URL to: https://localhost:8543/ * Trying 12x.0.0.1... * TCP_NODELAY set * Connected to localhost (12x.0.0.1) port 8543 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH * TLSv1.2 (OUT), TLS header, Certificate Status (22): * TLSv1.2 (OUT), TLS handshake, Client hello (1): * TLSv1.2 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Certificate (11): * TLSv1.2 (IN), TLS handshake, Server key exchange (12): * TLSv1.2 (IN), TLS handshake, Server finished (14): * TLSv1.2 (OUT), TLS handshake, Client key exchange (16): * TLSv1.2 (OUT), TLS change cipher, Client hello (1): * TLSv1.2 (OUT), TLS handshake, Finished (20): * TLSv1.2 (IN), TLS change cipher, Client hello (1): * TLSv1.2 (IN), TLS handshake, Finished (20): * SSL connection using TLSv1.2 / ECDHE-RSA-AES256-SHA384 * ALPN, server did not agree to a protocol * Server certificate: * subject: C=US; ST=California; L=Irvine; O=EMC; OU=Avamar; CN=localhost.localdom * start date: Feb 4 12:27:16 2022 GMT * expire date: Feb 2 12:27:16 2032 GMT * issuer: C=US; ST=California; L=Irvine; O=EMC; OU=Avamar; CN=localhost.localdom * SSL certificate verify result: self signed certificate (18), continuing anyway. > GET / HTTP/1.1 > Host: localhost:8543 > User-Agent: curl/7.60.0 > Accept: */* > < HTTP/1.1 302 < Set-Cookie: JSESSIONID=3396A12A1A458BBB4DDCB636A72B66EE; Path=/; Secure; HttpOnly < Location: ../dataprotection/ < Content-Type: text/html;charset=ISO-8859-1 < Content-Length: 0 < Date: Fri, 10 Feb 2023 05:42:58 GMT < Connection: close < Server: DataDomain < * Closing connection 0 * TLSv1.2 (OUT), TLS alert, Client hello (1):
Additional Information
Se a página da Web do ACM mostrar um "HTTP Status 500 - Internal Server Error" depois de seguir o procedimento acima, por exemplo:

Faça log-in no ACM usando o SSH como usuário root e, em seguida, reinicie o serviço do ACM com os seguintes comandos:
service dataprotection_webapp stop service dataprotection_webapp start
Em seguida, recarregue a página da Web do ACM novamente.
Entre em contato com o Suporte Dell para obter mais assistência, se necessário.