[완료]Apache 웹서버 응답 헤더 편집 또는 특정 정보 막는 방법은?
글쓴이: help@osori.org / 작성시간: 목, 2007/09/20 - 11:25오전
안녕하십니까 Linuxer광민 입니다.
오늘 wget 커맨드 man 페이지를 번역하다 의문이 하나 생겼습니다.
일반적인 웹서버에 경우 다음과 같이 wget 커맨드에 의해 헤더정보를 호출할 경우 SERVER 버전 및 심지어는 OS버전까지 노출이 되어집니다. 혹은 PHP등의 버전정보도 같이 나오게 되죠.
[root@Asianux2 /]# wget -S localhost --23:17:04-- http://localhost/ => `index.html' Resolving localhost... 127.0.0.1 Connecting to localhost|127.0.0.1|:80... connected. HTTP 요청이 전달되었습니다, 응답을 기다리는 중... HTTP/1.1 200 OK Date: Wed, 05 Sep 2007 14:17:04 GMT Server: Apache/2.0.52 (Asianux) Last-Modified: Wed, 05 Sep 2007 13:39:59 GMT ETag: "46fde-5-8abc89c0" Accept-Ranges: bytes Content-Length: 5 Connection: close Content-Type: text/html; charset=UTF-8 길이: 5 [text/html] 100%[========================================================================================>] 5 --.--K/s 23:17:04 (108.51 KB/s) - `index.html' saved [5/5] [root@Asianux2 /]# [root@Asianux2 /]# [root@Asianux2 /]# [root@Asianux2 /]# [root@Asianux2 /]# wget -S <a href="http://daum.net" rel="nofollow">http://daum.net</a> --23:17:14-- <a href="http://daum.net/ " rel="nofollow">http://daum.net/ </a> => `index.html.1' Resolving daum.net... 211.115.115.212, 211.115.77.211, 211.115.77.212, ... Connecting to daum.net|211.115.115.212|:80... connected. HTTP 요청이 전달되었습니다, 응답을 기다리는 중... HTTP/1.1 302 Found Date: Thu, 20 Sep 2007 02:22:07 GMT Server: Apache Location: <a href="http://www.daum.net/ " rel="nofollow">http://www.daum.net/ </a> Content-Length: 204 Connection: close Content-Type: text/html; charset=iso-8859-1 위치: <a href="http://www.daum.net/" rel="nofollow">http://www.daum.net/</a> [다음] --23:17:14-- <a href="http://www.daum.net/ " rel="nofollow">http://www.daum.net/ </a> => `index.html.1' Resolving <a href="http://www.daum.net" rel="nofollow">www.daum.net</a>... 211.115.77.212, 211.115.77.214, 211.115.115.211, ... Connecting to <a href="http://www.daum.net" rel="nofollow">www.daum.net</a>|211.115.77.212|:80... connected. HTTP 요청이 전달되었습니다, 응답을 기다리는 중... HTTP/1.1 200 OK Date: Thu, 20 Sep 2007 02:22:07 GMT Server: Apache Set-Cookie: Apache=203.229.169.225.1190254927300908; path=/; expires=Thu, 20-Sep-07 02:52:07 GMT; domain=.daum.net Expires: Sat, 01, Jan 1970 22:00:00 GMT Pragma: no-cache Cache-Control: no-cache Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=euc-kr 길이: 기술되지 않았음 [text/html] [ <=> ] 171,821 --.--K/s 23:17:14 (1.95 MB/s) - `index.html.1' saved [171821] [root@Asianux2 /]#
하지만 http://yahoo.co.kr을 질의 할경우
다음과 같이 웹서버 정보 및 OS 정보가 보호되어 출력되지 않습니다.
즉 웹서버의 응답 헤더부를 편집했다는 소리인데...
Apache 웹서버에서는 헤더설정을 어떤 방법으로 해야할까요?
[root@Asianux2 /]# wget -S <a href="http://yahoo.co.kr" rel="nofollow">http://yahoo.co.kr</a> --23:19:52-- <a href="http://yahoo.co.kr/ " rel="nofollow">http://yahoo.co.kr/ </a> => `index.html.2' Resolving yahoo.co.kr... 203.212.171.217, 211.115.99.172 Connecting to yahoo.co.kr|203.212.171.217|:80... connected. HTTP 요청이 전달되었습니다, 응답을 기다리는 중... HTTP/1.1 302 Found Date: Thu, 20 Sep 2007 02:24:28 GMT Location: <a href="http://kr.yahoo.com/ " rel="nofollow">http://kr.yahoo.com/ </a> Connection: close Content-Type: text/html 위치: <a href="http://kr.yahoo.com/" rel="nofollow">http://kr.yahoo.com/</a> [다음] --23:19:52-- <a href="http://kr.yahoo.com/ " rel="nofollow">http://kr.yahoo.com/ </a> => `index.html.2' Resolving kr.yahoo.com... 203.212.171.159 Connecting to kr.yahoo.com|203.212.171.159|:80... connected. HTTP 요청이 전달되었습니다, 응답을 기다리는 중... HTTP/1.1 200 OK Date: Thu, 20 Sep 2007 02:24:28 GMT P3P: policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV" Set-Cookie: ykfpBktS=36; expires=Sat, 29 Sep 2007 02:24:28 GMT; path=/; domain=yahoo.com Cache-Control: no-cache Connection: close Content-Type: text/html 길이: 기술되지 않았음 [text/html] [ <=> ] 179,600 --.--K/s 23:19:53 (2.86 MB/s) - `index.html.2' saved [179600] [root@Asianux2 /]#
Forums:
http://www.ihelpers.co.kr/pro
http://www.ihelpers.co.kr/programming/tipntech.php?CMD=view&IDX=416
# ServerTokens 지시자는
# ServerTokens 지시자는 apache의 header 정보를 어디 까지 보여줄지를 결정한다.
# ServerTokens Prod[uctOnly] Apache 만 보여줌
# ServerTokens Min[imal] Apache 버젼만 보여줌
# ServerTokens OS 아파치 버젼과 운영체제를 보여줌
# ServerTokens Full 모두 보여줌
# http://httpd.apache.org/docs/mod/core.html#servertokens 참조
#
ServerTokens Prod
---
답변 감사합니다 ^^ 즐거운 하루되셔요
# ServerTokens 지시자가 있었군요. 감사합니다 ^^
댓글 달기