질문&답변
클라우드/리눅스에 관한 질문과 답변을 주고 받는 곳입니다.
리눅스 분류

apache 응답 헤더 편집 또는 막기

작성자 정보

  • 최광민 작성
  • 작성일

컨텐츠 정보

본문

안녕하십니까 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 http://daum.net
--23:17:14-- http://daum.net/
=> `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: http://www.daum.net/
Content-Length: 204
Connection: close
Content-Type: text/html; charset=iso-8859-1
위치: http://www.daum.net/ [다음]
--23:17:14-- http://www.daum.net/
=> `index.html.1'
Resolving www.daum.net... 211.115.77.212, 211.115.77.214, 211.115.115.211, ...
Connecting to www.daum.net|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 http://yahoo.co.kr
--23:19:52-- http://yahoo.co.kr/
=> `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: http://kr.yahoo.com/
Connection: close
Content-Type: text/html
위치: http://kr.yahoo.com/ [다음]
--23:19:52-- http://kr.yahoo.com/
=> `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 /]#

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,040 명
  • 현재 강좌수 :  35,850 개
  • 현재 접속자 :  181 명