사용자 도구

사이트 도구


wiki:was:tomcat:tip:tomcat_버전_정보_숨기기

Tomcat 서버 버전정보 숨기기

  • description : Tomcat 서버의 버전정보 및 오류 내용을 숨기는 방법
  • author : 김토피아
  • email : kimmk@repia.com
  • lastupdate : 2023-07-06

취약점 내용

항목명 : 에러 메시지 관리 (사용자 화면) 중요도 : 중 항목개요 : 공격자가 대상 시스템의 정보를 획득하기 위해 고의적으로 다양한 에러를 유발하여 돌아오는 에러 메세지를 통해 웹 프로그램 구조 및 환경설정을 추정할 수 있음

판단기준

양호: 에러 페이지 설정과 에러 페이지가 모두 존재할 경우
취약: 에러 페이지 설정이 없거나 에러 페이지가 없을 경우

tomcat 오류 화면

조치 방법

1. {$CATALINA_HOME}/webapps/ROOT 디렉토리에 error.jsp 에러 페이지 생성

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>404 Not Found</title>
</head>
<body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body>
</html>

2. {$CATALINA_HOME}/conf web.xml에 에러 페이지 설정

web.xml 제일 하단 </welcome-file-list> </web-app> 사이에 넣고 톰캣 재시작

<error-page>
<error-code>401</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>402</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>403</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>405</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>406</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>407</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>408</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>409</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>410</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>411</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>412</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>413</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>414</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>415</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>501</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>502</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>503</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>504</error-code>
<location>/error.jsp</location>
</error-page>
 
<error-page>
<error-code>505</error-code>
<location>/error.jsp</location>
</error-page>
/var/services/web/dokuwiki/data/pages/wiki/was/tomcat/tip/tomcat_버전_정보_숨기기.txt · 마지막으로 수정됨: 2023/07/06 15:59 저자 r_kimmk