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