[완료]Apache 웹서버 응답 헤더 편집 또는 특정 정보 막는 방법은?

help@osori.org의 이미지

안녕하십니까 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 /]# 
ironiris의 이미지

# 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
---

help@osori.org의 이미지

# ServerTokens 지시자가 있었군요. 감사합니다 ^^

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.