아파치 HTTP 헤더정보 설정(아파치,php 버전 노출 설정)

  • 아파치 설정 중 “ServerTokens” 옵션을 변경
    • 지원 옵션 : Full, OS, Minimal, Minor, Major, Prod
  • 확인 방법 : Telnet으로 httpd 포트 접속 후 헤더확인 값 입력
[root@sv ~]# telnet localhost 80
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
HEAD / HTTP/1.0

HTTP/1.1 200 OK
Date: Thu, 17 Mar 2016 00:17:34 GMT
Server: Microsoft-IIS/5.0
X-Powered-By: PHP/5.3.29
Cache-Control: max-age=3, must-revalidate
Expires: Thu, 17 Mar 2016 00:17:37 GMT
Vary: Accept-Encoding,Cookie
Connection: close
Content-Type: text/html; charset=UTF-8

Connection closed by foreign host.
  • 옵션별 출력 내용
    • ServerTokens Full
HTTP/1.1 400 Bad Request
Date: Wed, 16 Mar 2016 04:39:38 GMT
Server: Apache/2.4.18 (Unix) PHP/5.5.33
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1
  • ServerTokens OS
HTTP/1.1 400 Bad Request
Date: Wed, 16 Mar 2016 04:41:01 GMT
Server: Apache/2.4.18 (Unix)
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1
  • ServerTokens Minor
HTTP/1.1 400 Bad Request
Date: Wed, 16 Mar 2016 04:41:52 GMT
Server: Apache/2.4
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1
  • ServerTokens Minimal
HTTP/1.1 400 Bad Request
Date: Wed, 16 Mar 2016 04:42:29 GMT
Server: Apache/2.4.18
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1
  • ServerTokens Major
HTTP/1.1 400 Bad Request
Date: Wed, 16 Mar 2016 04:42:58 GMT
Server: Apache/2
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1
  • ServerTokens Prod
HTTP/1.1 400 Bad Request
Date: Wed, 16 Mar 2016 04:43:33 GMT
Server: Apache
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1